X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fmsvideo1.c;h=c9bcce552d087594d6b421951c6ee131cc0a9055;hb=e786e37326d4274c1dfbc37a6478680684c779c9;hp=29700f54b66e9829729f3a6630298dcd7f44e32a;hpb=fb4a12cda4033f2f3d3d1039739f6e0e6f9afb82;p=ffmpeg diff --git a/libavcodec/msvideo1.c b/libavcodec/msvideo1.c index 29700f54b66..c9bcce552d0 100644 --- a/libavcodec/msvideo1.c +++ b/libavcodec/msvideo1.c @@ -62,6 +62,9 @@ static av_cold int msvideo1_decode_init(AVCodecContext *avctx) s->avctx = avctx; + if (avctx->width < 4 || avctx->height < 4) + return AVERROR_INVALIDDATA; + /* figure out the colorspace based on the presence of a palette */ if (s->avctx->bits_per_coded_sample == 8) { s->mode_8bit = 1; @@ -307,7 +310,7 @@ static int msvideo1_decode_frame(AVCodecContext *avctx, return AVERROR_INVALIDDATA; } - if ((ret = ff_reget_buffer(avctx, s->frame)) < 0) + if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0) return ret; if (s->mode_8bit) {