mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec/cbs_av1: Fix writing uvlc numbers >= INT_MAX
Fixes: assertion failure Fixes: left shift of 1 by 31 places cannot be represented in type 'int' Fixes: 23264/clusterfuzz-testcase-minimized-ffmpeg_BSF_AV1_METADATA_fuzzer-6308429248593920 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
8ee6557c2e
commit
6f06c17a55
@ -125,8 +125,9 @@ static int cbs_av1_write_uvlc(CodedBitstreamContext *ctx, PutBitContext *pbc,
|
||||
put_bits(pbc, 1, 1);
|
||||
} else {
|
||||
zeroes = av_log2(value + 1);
|
||||
v = value - (1 << zeroes) + 1;
|
||||
put_bits(pbc, zeroes + 1, 1);
|
||||
v = value - (1U << zeroes) + 1;
|
||||
put_bits(pbc, zeroes, 0);
|
||||
put_bits(pbc, 1, 1);
|
||||
put_bits(pbc, zeroes, v);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user