diff --git a/libavcodec/fmvc.c b/libavcodec/fmvc.c index 1f8b0c5c17..ff5f291da6 100644 --- a/libavcodec/fmvc.c +++ b/libavcodec/fmvc.c @@ -561,6 +561,9 @@ static av_cold int decode_init(AVCodecContext *avctx) } s->nb_blocks = s->xb * s->yb; + if (!s->nb_blocks) + return AVERROR_INVALIDDATA; + s->blocks = av_calloc(s->nb_blocks, sizeof(*s->blocks)); if (!s->blocks) return AVERROR(ENOMEM);