bink: Bound check the quantization matrix.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 9991298f2c)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
Luca Barbato
2013-08-04 18:48:20 +02:00
parent cb31b6ca72
commit c5ba226c1b

View File

@@ -677,6 +677,9 @@ static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *
quant_idx = q; quant_idx = q;
} }
if (quant_idx >= 16)
return AVERROR_INVALIDDATA;
quant = quant_matrices[quant_idx]; quant = quant_matrices[quant_idx];
block[0] = (block[0] * quant[0]) >> 11; block[0] = (block[0] * quant[0]) >> 11;