diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index 7988e1f36b..39305f74a6 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -593,6 +593,11 @@ av_cold int ff_msmpeg4_decode_init(AVCodecContext *avctx) int i; MVTable *mv; + if(avctx->width<=0 || avctx->height<=0) { + av_log(avctx, AV_LOG_ERROR, "invalid dimensions\n"); + return -1; + } + if (ff_h263_decode_init(avctx) < 0) return -1;