mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
avcodec/wavpack: Avoid undefined shift in get_tail()
Fixes: left shift of 1208485947 by 1 places cannot be represented in type 'int' Fixes: 54058/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVPACK_fuzzer-5827521084260352 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:
parent
6af453ca38
commit
8374a747af
@ -129,7 +129,7 @@ static av_always_inline unsigned get_tail(GetBitContext *gb, unsigned k)
|
||||
e = (1LL << (p + 1)) - k - 1;
|
||||
res = get_bits_long(gb, p);
|
||||
if (res >= e)
|
||||
res = (res << 1) - e + get_bits1(gb);
|
||||
res = res * 2U - e + get_bits1(gb);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user