X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fzmbv.c;h=8727bfc8b91fe62a2264cfd818d428d527a1a519;hb=03b078721c8e42c413da75f553e740d235092dad;hp=762d5728a253a37fa515622db4d6cde55cabbce4;hpb=4d54ecf4b8e897e993911ff51d53f52de88f29d5;p=ffmpeg diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c index 762d5728a25..8727bfc8b91 100644 --- a/libavcodec/zmbv.c +++ b/libavcodec/zmbv.c @@ -502,8 +502,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac } if (c->comp == 0) { //Uncompressed data + if (c->decomp_size < len) { + av_log(avctx, AV_LOG_ERROR, "decomp buffer too small\n"); + return AVERROR_INVALIDDATA; + } memcpy(c->decomp_buf, buf, len); - c->decomp_size = 1; } else { // ZLIB-compressed data c->zstream.total_in = c->zstream.total_out = 0; c->zstream.next_in = (uint8_t*)buf;