Commit fc4f8837 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/wavpack: Fix invalid shift and integer overflow

Fixes: 940/clusterfuzz-testcase-5200378381467648

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent d2657d22
......@@ -157,7 +157,7 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
} else {
t = get_unary_0_33(gb);
if (t >= 2) {
if (get_bits_left(gb) < t - 1)
if (t >= 32 || get_bits_left(gb) < t - 1)
goto error;
t = get_bits_long(gb, t - 1) | (1 << (t - 1));
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment