aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-08-04 18:48:20 +0200
committerSean McGovern <gseanmcg@gmail.com>2013-09-23 19:41:08 -0400
commit9c779b5dd0e8ce296aa2125877c8276775b8423e (patch)
tree2672807c0dd14a5c03e93dd5cdd74f9d0e771092
parent8006716f215582ed396d9392809a174c26209f97 (diff)
downloadffmpeg-9c779b5dd0e8ce296aa2125877c8276775b8423e.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 f38c030b7c..47fcc81172 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -675,6 +675,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;