diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-11 18:08:39 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-11 18:09:11 +0100 |
commit | 44c23aa1b85d195db6647d24e3b1d3de051790db (patch) | |
tree | d68b05a44c996a3cd603ff855d7c4c45a7f08ea4 /libavcodec/zmbv.c | |
parent | 3ba58433e17cb6019e512e7fa5cf4e38415217d3 (diff) | |
download | ffmpeg-44c23aa1b85d195db6647d24e3b1d3de051790db.tar.gz |
zmbvdec: check decompression buffer size.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/zmbv.c')
-rw-r--r-- | libavcodec/zmbv.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c index 762d5728a2..8727bfc8b9 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; |