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

Michael Niedermayer git at videolan.org
Wed Mar 8 22:15:40 EET 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Mar  6 21:52:36 2017 +0100| [3016e919d4e1d90da98af19ce2a9d4979506eaf3] | committer: Michael Niedermayer

avcodec/wavpack: Fix runtime error: left shift of negative value -5

Fixes: 729/clusterfuzz-testcase-5154831595470848

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=3016e919d4e1d90da98af19ce2a9d4979506eaf3
---

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

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index a4ba07f..943e46a 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -273,7 +273,7 @@ static inline int wv_get_value_integer(WavpackFrameContext *s, uint32_t *crc,
     unsigned bit;
 
     if (s->extra_bits) {
-        S <<= s->extra_bits;
+        S *= 1 << s->extra_bits;
 
         if (s->got_extra_bits &&
             get_bits_left(&s->gb_extra_bits) >= s->extra_bits) {



More information about the ffmpeg-cvslog mailing list