[FFmpeg-devel] [PATCH] avcodec/wavpack: Change wp_log2() to unsigned

Michael Niedermayer michael at niedermayer.cc
Fri Jun 9 19:47:52 EEST 2017


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 at niedermayer.cc>
---
 libavcodec/wavpack.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/wavpack.h b/libavcodec/wavpack.h
index c949390f51..c670b1c1d9 100644
--- a/libavcodec/wavpack.h
+++ b/libavcodec/wavpack.h
@@ -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;
 
-- 
2.13.0



More information about the ffmpeg-devel mailing list