You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/osq: Switch back to av_ceil_log2()
This returns to code closer to prior 56c334d732
The prior fixes should limit the sum and avoid the need for double argument log2()
Fixes: Assertion n>=0 && n<=32 failed at libavcodec/get_bits.h:406
Fixes: 410109093/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6550900028276736
No testcases except fuzzers
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@ -165,7 +165,8 @@ static int update_residue_parameter(OSQChannel *cb)
|
|||||||
if (!sum)
|
if (!sum)
|
||||||
return 0;
|
return 0;
|
||||||
x = sum / cb->count;
|
x = sum / cb->count;
|
||||||
rice_k = ceil(log2(x));
|
av_assert2(x <= 0x80000000U);
|
||||||
|
rice_k = av_ceil_log2(x);
|
||||||
if (rice_k >= 30) {
|
if (rice_k >= 30) {
|
||||||
double f = floor(sum / 1.4426952 + 0.5);
|
double f = floor(sum / 1.4426952 + 0.5);
|
||||||
if (f <= 1) {
|
if (f <= 1) {
|
||||||
|
Reference in New Issue
Block a user