Commit 4020b009 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/wavpack: Check float_shift

Fixes: runtime error: shift exponent 40 is too large for 32-bit type 'unsigned int'
Fixes: 1898/clusterfuzz-testcase-minimized-5970744880136192

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent d90c5bf1
......@@ -887,6 +887,12 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
s->float_flag = bytestream2_get_byte(&gb);
s->float_shift = bytestream2_get_byte(&gb);
s->float_max_exp = bytestream2_get_byte(&gb);
if (s->float_shift > 31) {
av_log(avctx, AV_LOG_ERROR,
"Invalid FLOATINFO, shift = %d (> 31)\n", s->float_shift);
s->float_shift = 0;
continue;
}
got_float = 1;
bytestream2_skip(&gb, 1);
break;
......
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