avcodec/g726: Fix runtime error: left shift of negative value -2
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 7 May 2017 13:40:07 +0000 (15:40 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 7 May 2017 17:32:33 +0000 (19:32 +0200)
Fixes: 1393/clusterfuzz-testcase-minimized-5948366791901184

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

index ca7f856..6922b40 100644 (file)
@@ -269,7 +269,7 @@ static int16_t g726_decode(G726Context* c, int I)
         c->se += mult(i2f(c->a[i] >> 2, &f), &c->sr[i]);
     c->se >>= 1;
 
-    return av_clip(re_signal << 2, -0xffff, 0xffff);
+    return av_clip(re_signal * 4, -0xffff, 0xffff);
 }
 
 static av_cold int g726_reset(G726Context *c)