aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-12-18 17:55:09 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2023-04-21 01:55:10 +0200
commite02bd110909126678dfc3f4015ba789b1fd9a22a (patch)
treee3236061598b58b0c06bba9f6d925e1f5bce0f0a
parent9980d388b96f5081ccf352cf8e5034d3b438fc52 (diff)
downloadffmpeg-e02bd110909126678dfc3f4015ba789b1fd9a22a.tar.gz
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 8374a747af247d45eb466fcb4aee90f3ae798aad) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wavpack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index d0242809fe..132ed668b9 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -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;
}