diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-16 16:27:08 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-16 16:27:34 +0200 |
commit | 8e77c3846e91b1af9df4084736257d9899156eef (patch) | |
tree | ce75eb7878326b706b466b3d9b7ba4163c8186c4 | |
parent | bdeb54e176473b2c9187d4e0ee087b9876447285 (diff) | |
download | ffmpeg-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.c | 2 |
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]; } |