From 8a20774a24bb1ea68b7360113746eac6e59ad8a8 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 24 Mar 2012 12:29:05 +0100 Subject: [PATCH] indeo4: Fix global array overread. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavcodec/indeo4.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c index 1d280a0c53..1265201541 100644 --- a/libavcodec/indeo4.c +++ b/libavcodec/indeo4.c @@ -404,6 +404,10 @@ static int decode_band_hdr(IVI4DecContext *ctx, IVIBandDesc *band, av_log(avctx, AV_LOG_ERROR, "Custom quant matrix encountered!\n"); return AVERROR_INVALIDDATA; } + if (band->quant_mat > 21) { + av_log(avctx, AV_LOG_ERROR, "Invalid quant matrix encountered!\n"); + return AVERROR_INVALIDDATA; + } } /* decode block huffman codebook */