avcodec/aacdec_fixed: Fix multiple runtime error: shift exponent 127 is too large...
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 23 May 2017 10:40:22 +0000 (12:40 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 23 May 2017 14:11:27 +0000 (16:11 +0200)
Fixes: 1762/clusterfuzz-testcase-minimized-5150981081792512

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/aacdec_fixed.c

index 7b5e40e..2754766 100644 (file)
@@ -415,7 +415,9 @@ static void apply_independent_coupling_fixed(AACContext *ac,
 
     c = cce_scale_fixed[gain & 7];
     shift = (gain-1024) >> 3;
-    if (shift < 0) {
+    if (shift < -31) {
+        return;
+    } else if (shift < 0) {
         shift = -shift;
         round = 1 << (shift - 1);