[FFmpeg-cvslog] indeo4: check quant_mat more fully.
Michael Niedermayer
git at videolan.org
Mon Apr 23 23:03:15 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Apr 23 21:40:02 2012 +0200| [29545741266a03332f2758c7ba4f77f362c3668d] | committer: Michael Niedermayer
indeo4: check quant_mat more fully.
quant_mats valid range depends on the block size.
This fixes a global array overread.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=29545741266a03332f2758c7ba4f77f362c3668d
---
libavcodec/indeo4.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c
index 45ff619..6615b63 100644
--- a/libavcodec/indeo4.c
+++ b/libavcodec/indeo4.c
@@ -420,7 +420,11 @@ static int decode_band_hdr(IVI4DecContext *ctx, IVIBandDesc *band,
}
band->quant_mat = quant_mat;
}
-
+ if (quant_index_to_tab[band->quant_mat] > 4 && band->blk_size == 4) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid quant matrix for 4x4 block encountered!\n");
+ band->quant_mat = 0;
+ return AVERROR_INVALIDDATA;
+ }
/* decode block huffman codebook */
if (ff_ivi_dec_huff_desc(&ctx->gb, get_bits1(&ctx->gb), IVI_BLK_HUFF,
&band->blk_vlc, avctx))
More information about the ffmpeg-cvslog
mailing list