avcodec/aacdec_fixed: fix: left shift of negative value -1
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 23 Jul 2017 14:52:47 +0000 (16:52 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 25 Jul 2017 22:11:54 +0000 (00:11 +0200)
Fixes: 2699/clusterfuzz-testcase-minimized-5631303862976512

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 2dfb8c417891e0cc3670f8e0791ea0c7071314fe)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/aacdec_fixed.c

index 0cac3bf..ccc8205 100644 (file)
@@ -430,7 +430,7 @@ static void apply_independent_coupling_fixed(AACContext *ac,
     else {
       for (i = 0; i < len; i++) {
           tmp = (int)(((int64_t)src[i] * c + (int64_t)0x1000000000) >> 37);
-          dest[i] += tmp << shift;
+          dest[i] += tmp * (1 << shift);
       }
     }
 }