avcodec/aacdec_fixed: Fix undefined shift
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 5 Nov 2017 20:20:07 +0000 (21:20 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 30 Dec 2017 20:11:31 +0000 (21:11 +0100)
Fixes: runtime error: left shift of negative value -801112064
Fixes: 3492/clusterfuzz-testcase-minimized-5784775283441664

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

index 1aaa6a2..6ba0e63 100644 (file)
@@ -309,7 +309,7 @@ static av_always_inline void predict(PredictorState *ps, int *coef,
             if (shift > 0) {
                 *coef += (unsigned)((pv.mant + (1 << (shift - 1))) >> shift);
             } else
-                *coef += (unsigned)(pv.mant << -shift);
+                *coef += (unsigned)pv.mant << -shift;
         }
     }