[FFmpeg-cvslog] avcodec/g726: Fix runtime error: left shift of negative value -2

Michael Niedermayer git at videolan.org
Sun May 7 20:33:07 EEST 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun May  7 15:40:07 2017 +0200| [c04aa148824f4fb7f4b70830ad3ca7a6cba8ab79] | committer: Michael Niedermayer

avcodec/g726: Fix runtime error: left shift of negative value -2

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 at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c04aa148824f4fb7f4b70830ad3ca7a6cba8ab79
---

 libavcodec/g726.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/g726.c b/libavcodec/g726.c
index ca7f856eac..6922b40f87 100644
--- a/libavcodec/g726.c
+++ b/libavcodec/g726.c
@@ -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)



More information about the ffmpeg-cvslog mailing list