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>
(cherry picked from commit 8374a747af)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2022-12-18 17:55:09 +01:00
parent ba9e8fa53a
commit 662c3060b9
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ static av_always_inline unsigned get_tail(GetBitContext *gb, int k)
e = (1 << (p + 1)) - k - 1;
res = get_bitsz(gb, p);
if (res >= e)
res = (res << 1) - e + get_bits1(gb);
res = res * 2U - e + get_bits1(gb);
return res;
}