aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-14 23:24:05 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-14 23:54:00 +0100
commite70144cba13db208877e3b64802fc8835c72e82d (patch)
treea6e9787f79a00bf4867f7891ddaa7c5f02acd6c8
parent612ecfbbbb3f4238d44cca5f250ffc6147d03ec2 (diff)
downloadffmpeg-e70144cba13db208877e3b64802fc8835c72e82d.tar.gz
bink: check quant_index, fix out of array read
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/bink.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 91cd651468..bcc6361c7a 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -674,6 +674,10 @@ static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *
quant_idx = get_bits(gb, 4);
} else {
quant_idx = q;
+ if (quant_idx > 15U) {
+ av_log(0, AV_LOG_ERROR, "quant_index %d out of range\n", quant_idx);
+ return AVERROR_INVALIDDATA;
+ }
}
quant = quant_matrices[quant_idx];