summaryrefslogtreecommitdiff
path: root/libavcodec/bink.c
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-05 16:24:13 +0200
commit9991298f2c4d9022ad56057f15d037e18d454157 (patch)
tree36bdee90cbe8cf1297bbc2a59d46ce4e031351db /libavcodec/bink.c
parentbb9378251a167ef0116f263912e57f715c1e02ac (diff)
downloadffmpeg-9991298f2c4d9022ad56057f15d037e18d454157.tar.gz
bink: Bound check the quantization matrix.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/bink.c')
-rw-r--r--libavcodec/bink.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 7ec0cabaed..98a54c6969 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -681,6 +681,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;