avcodec/aacdec_template: Fix fixed point scale in decode_cce()
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 17 May 2017 13:51:46 +0000 (15:51 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 17 May 2017 14:17:56 +0000 (16:17 +0200)
Fixes: runtime error: shift exponent 1073741824 is too large for 32-bit type 'int'
Fixes: 1654/clusterfuzz-testcase-minimized-5151903795118080

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

index d034ae4..a3780c6 100644 (file)
@@ -2181,7 +2181,11 @@ static int decode_cce(AACContext *ac, GetBitContext *gb, ChannelElement *che)
     coup->coupling_point += get_bits1(gb) || (coup->coupling_point >> 1);
 
     sign  = get_bits(gb, 1);
-    scale = AAC_RENAME(cce_scale)[get_bits(gb, 2)];
+#if USE_FIXED
+    scale = get_bits(gb, 2);
+#else
+    scale = cce_scale[get_bits(gb, 2)];
+#endif
 
     if ((ret = decode_ics(ac, sce, gb, 0, 0)))
         return ret;