Skip to content

Commit

Permalink
avutil/common: Fix integer overflow in av_ceil_log2_c()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
michaelni committed Jun 30, 2020
1 parent 21598d7 commit e409262
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavutil/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,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);
}

/**
Expand Down

0 comments on commit e409262

Please sign in to comment.