summaryrefslogtreecommitdiff
path: root/libavcodec/indeo5.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-31 05:01:28 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-31 05:07:51 +0200
commit8aaa00c3012d425ce50efffadb813ad62d1ff3d5 (patch)
treea69c867efe60d2413734e982ee1b8939e4010f1a /libavcodec/indeo5.c
parent3b275ce3747a311b05d78eaba41798145164a4d4 (diff)
downloadffmpeg-8aaa00c3012d425ce50efffadb813ad62d1ff3d5.tar.gz
indeo5: check quant_mat
prevents out of array read Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/indeo5.c')
-rw-r--r--libavcodec/indeo5.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c
index 3c7242a824..e989690644 100644
--- a/libavcodec/indeo5.c
+++ b/libavcodec/indeo5.c
@@ -199,6 +199,10 @@ static int decode_gop_header(IVI45DecContext *ctx, AVCodecContext *avctx)
}
if (band->blk_size == 8) {
+ if(quant_mat >= 5){
+ av_log(avctx, AV_LOG_ERROR, "quant_mat %d too large!\n", quant_mat);
+ return -1;
+ }
band->intra_base = &ivi5_base_quant_8x8_intra[quant_mat][0];
band->inter_base = &ivi5_base_quant_8x8_inter[quant_mat][0];
band->intra_scale = &ivi5_scale_quant_8x8_intra[quant_mat][0];