avcodec/takdec: Fix runtime error: left shift of negative value -360
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 22 May 2017 19:43:01 +0000 (21:43 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 22 May 2017 19:43:39 +0000 (21:43 +0200)
Fixes: 1739/clusterfuzz-testcase-minimized-5399237707694080

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

index 081b2f2..78e82a9 100644 (file)
@@ -653,7 +653,7 @@ static int decorrelate(TAKDecContext *s, int c1, int c2, int length)
                          s->residues[i    ] * s->filter[0];
                 }
 
-                v = (av_clip_intp2(v >> 10, 13) << dshift) - *p1;
+                v = av_clip_intp2(v >> 10, 13) * (1 << dshift) - *p1;
                 *p1++ = v;
             }