aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-16 16:27:08 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-16 16:27:34 +0200
commit8e77c3846e91b1af9df4084736257d9899156eef (patch)
treece75eb7878326b706b466b3d9b7ba4163c8186c4
parentbdeb54e176473b2c9187d4e0ee087b9876447285 (diff)
downloadffmpeg-8e77c3846e91b1af9df4084736257d9899156eef.tar.gz
dcadec: fix global array overread.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/dca.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index d9fafbad01..1d0cf3a4ec 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -805,7 +805,7 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index)
"Invalid channel mode %d\n", am);
return AVERROR_INVALIDDATA;
}
- for (j = base_channel; j < s->prim_channels; j++) {
+ for (j = base_channel; j < FFMIN(s->prim_channels, FF_ARRAY_ELEMS(dca_default_coeffs[am])); j++) {
s->downmix_coef[j][0] = dca_default_coeffs[am][j][0];
s->downmix_coef[j][1] = dca_default_coeffs[am][j][1];
}