[FFmpeg-cvslog] avutil/common: Fix integer overflow in av_ceil_log2_c()

Michael Niedermayer git at videolan.org
Sun Jul 5 20:51:34 EEST 2020


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sun Jun 28 00:21:09 2020 +0200| [449bdf05f8843c675e96daa04ecf08f1a013fbd9] | committer: Michael Niedermayer

avutil/common: Fix integer overflow in av_ceil_log2_c()

Fixes: left shift of 1913647649 by 1 places cannot be represented in type 'int'
Fixes: 23572/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5082619795734528

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit e409262837712016097c187e97bf99aadf6a4cdf)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=449bdf05f8843c675e96daa04ecf08f1a013fbd9
---

 libavutil/common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/common.h b/libavutil/common.h
index ee7028e1fb..ed2710681a 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -311,7 +311,7 @@ static av_always_inline av_const double av_clipd_c(double a, double amin, double
  */
 static av_always_inline av_const int av_ceil_log2_c(int x)
 {
-    return av_log2((x - 1) << 1);
+    return av_log2((x - 1U) << 1);
 }
 
 /**



More information about the ffmpeg-cvslog mailing list