aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2016-05-26 02:41:25 +0200
committerLuca Barbato <lu_zero@gentoo.org>2016-05-27 15:49:48 +0200
commit5264e7ba217b3c0ceae813917134e1ab52573141 (patch)
treeb252a31ecbc3262f652f492abec6f1b6d4bdcea4
parenta86aa16088ad7f22a8918d71adb8c040d6033d84 (diff)
downloadffmpeg-5264e7ba217b3c0ceae813917134e1ab52573141.tar.gz
ac3: Check the array bound before dereferencing
CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r--libavcodec/ac3enc_template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ac3enc_template.c b/libavcodec/ac3enc_template.c
index 8febf858ef..ec8ec4ef6a 100644
--- a/libavcodec/ac3enc_template.c
+++ b/libavcodec/ac3enc_template.c
@@ -260,7 +260,7 @@ static void apply_channel_coupling(AC3EncodeContext *s)
energy_cpl = energy[blk][CPL_CH][bnd];
energy_ch = energy[blk][ch][bnd];
blk1 = blk+1;
- while (!s->blocks[blk1].new_cpl_coords[ch] && blk1 < s->num_blocks) {
+ while (blk1 < s->num_blocks && !s->blocks[blk1].new_cpl_coords[ch]) {
if (s->blocks[blk1].cpl_in_use) {
energy_cpl += energy[blk1][CPL_CH][bnd];
energy_ch += energy[blk1][ch][bnd];