X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fbmp.c;h=b6bc8306625ecc0fda683c42e6072c7f5aa3258c;hb=7432bcfe5a36331502c49fe03aefe39b9936247a;hp=b249f312d48576d0e3e9e720a2416c6c007e9d1f;hpb=c3c2db49a7b10d0b57594332ee3c2cf4aa7552f2;p=ffmpeg diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c index b249f312d48..b6bc8306625 100644 --- a/libavcodec/bmp.c +++ b/libavcodec/bmp.c @@ -53,6 +53,7 @@ static int bmp_decode_frame(AVCodecContext *avctx, uint8_t *ptr; int dsize; const uint8_t *buf0 = buf; + GetByteContext gb; if(buf_size < 14){ av_log(avctx, AV_LOG_ERROR, "buf size too small (%d)\n", buf_size); @@ -269,7 +270,8 @@ static int bmp_decode_frame(AVCodecContext *avctx, p->data[0] += p->linesize[0] * (avctx->height - 1); p->linesize[0] = -p->linesize[0]; } - ff_msrle_decode(avctx, (AVPicture*)p, depth, buf, dsize); + bytestream2_init(&gb, buf, dsize); + ff_msrle_decode(avctx, (AVPicture*)p, depth, &gb); if(height < 0){ p->data[0] += p->linesize[0] * (avctx->height - 1); p->linesize[0] = -p->linesize[0]; @@ -356,5 +358,5 @@ AVCodec ff_bmp_decoder = { .close = bmp_decode_end, .decode = bmp_decode_frame, .capabilities = CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("BMP image"), + .long_name = NULL_IF_CONFIG_SMALL("BMP image"), };