aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-14 14:42:45 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-20 03:41:33 +0200
commitb17779fc14b7c6f23244521d80785177c0066c46 (patch)
treeb0fb87b01dbfe3c0f8a8e50038f0d796fc68001d /libavcodec
parent12f969bd2c572c882fc2a1172582129543fa9f89 (diff)
downloadffmpeg-b17779fc14b7c6f23244521d80785177c0066c46.tar.gz
avcodec/ac3dec: Fix: runtime error: index -1 out of bounds for type 'INTFLOAT [2]'
It seems dual mono with a LFE channel is not forbidden Fixes: 1570/clusterfuzz-testcase-minimized-6455337349545984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit c55e637072b694a1db40e21948d218bfa2e744bb) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ac3dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 29f0bacc3a..138bb69298 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -1338,7 +1338,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
for (ch = 1; ch <= s->channels; ch++) {
int audio_channel = 0;
INTFLOAT gain;
- if (s->channel_mode == AC3_CHMODE_DUALMONO)
+ if (s->channel_mode == AC3_CHMODE_DUALMONO && ch <= 2)
audio_channel = 2-ch;
if (s->heavy_compression && s->compression_exists[audio_channel])
gain = s->heavy_dynamic_range[audio_channel];