avcodec/wavpack: Change wp_log2() to unsigned
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 9 Jun 2017 11:49:30 +0000 (13:49 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 16 Jun 2017 18:32:39 +0000 (20:32 +0200)
Fixes: runtime error: signed integer overflow: 2143315325 + 4186162 cannot be represented in type 'int'
Fixes: 2134/clusterfuzz-testcase-minimized-4619258405322752

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.h

index 053b1c5..3ae601f 100644 (file)
@@ -177,7 +177,7 @@ static av_always_inline int wp_exp2(int16_t val)
     return neg ? -res : res;
 }
 
-static av_always_inline int wp_log2(int32_t val)
+static av_always_inline int wp_log2(uint32_t val)
 {
     int bits;