aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-08-04 18:48:20 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-08-24 16:14:22 +0200
commitc5ba226c1b0b76c1e7fad17a1448b793240671f6 (patch)
treebd26a43d27200dad5091e6c899b3cc77d4e85a92
parentcb31b6ca724774057822ed65a818a41db8072e06 (diff)
downloadffmpeg-c5ba226c1b0b76c1e7fad17a1448b793240671f6.tar.gz
bink: Bound check the quantization matrix.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org (cherry picked from commit 9991298f2c4d9022ad56057f15d037e18d454157) Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r--libavcodec/bink.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 059601debf..c637f4e33f 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -677,6 +677,9 @@ static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *
quant_idx = q;
}
+ if (quant_idx >= 16)
+ return AVERROR_INVALIDDATA;
+
quant = quant_matrices[quant_idx];
block[0] = (block[0] * quant[0]) >> 11;