avcodec/aacdec_fixed: Fix runtime error: left shift of 1 by 31 places cannot be repre...
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 28 May 2017 16:09:47 +0000 (18:09 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 28 May 2017 16:27:43 +0000 (18:27 +0200)
Fixes: 1878/clusterfuzz-testcase-minimized-6441918630199296

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 950ce20..d8786df 100644 (file)
@@ -211,8 +211,8 @@ static void noise_scale(int *coefs, int scale, int band_energy, int len)
         for (i=0; i<len; i++) {
             coefs[i] = 0;
         }
-    } else if (s > 0) {
-        round = 1 << (s-1);
+    } else if (s >= 0) {
+        round = s ? 1 << (s-1) : 0;
         for (i=0; i<len; i++) {
             out = (int)(((int64_t)coefs[i] * c) >> 32);
             coefs[i] = ((int)(out+round) >> s) * ssign;