aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-09-27 20:34:44 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-11-28 18:44:38 +0100
commitc658f6c34d0fc7c833e81aac4a661f9e98e5a3e1 (patch)
tree98d05286ce289c05aee75ef805a69d1f8299bbfe
parent8dd6075a7f286e46d01da6790ec66a5a9d42a5f9 (diff)
downloadffmpeg-c658f6c34d0fc7c833e81aac4a661f9e98e5a3e1.tar.gz
avcodec/ac3enc_template: fix out of array read
Found-by: Andreas Cadhalpun Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit d85ebea3f3b68ebccfe308fa839fc30fa634e4de) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-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 354be53c7f..69dd135898 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];