avcodec/wavpack: Fix runtime error: left shift of negative value -1
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 24 May 2017 17:53:57 +0000 (19:53 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 24 May 2017 18:03:06 +0000 (20:03 +0200)
Fixes: 1807/clusterfuzz-testcase-minimized-6258676199325696

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

index 74ca2d4..103a416 100644 (file)
@@ -310,7 +310,7 @@ static float wv_get_value_float(WavpackFrameContext *s, uint32_t *crc, int S)
     }
 
     if (S) {
-        S  <<= s->float_shift;
+        S  *= 1 << s->float_shift;
         sign = S < 0;
         if (sign)
             S = -S;