X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fzmbv.c;h=f91d2e393179d4a025ba1fef28ed5c73955aff35;hb=af964baf090616fbd858e8937d95bf1f1d8be277;hp=b09dc41ebd2aea08b21d33ea1998678cf82eef60;hpb=1a24d4f020ee52154d2b369d6fc3d5056b5719c8;p=ffmpeg diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c index b09dc41ebd2..f91d2e39317 100644 --- a/libavcodec/zmbv.c +++ b/libavcodec/zmbv.c @@ -539,6 +539,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac } else { frame->key_frame = 0; frame->pict_type = AV_PICTURE_TYPE_P; + if (c->decomp_len < 2LL * ((c->width + c->bw - 1) / c->bw) * ((c->height + c->bh - 1) / c->bh)) + return AVERROR_INVALIDDATA; if (c->decomp_len) c->decode_xor(c); }