avcodec/wavpack: Fix runtime error: left shift of negative value -5
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 6 Mar 2017 20:52:36 +0000 (21:52 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 8 Mar 2017 20:15:07 +0000 (21:15 +0100)
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@niedermayer.cc>
libavcodec/wavpack.c

index a4ba07f..943e46a 100644 (file)
@@ -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) {