Commit 9d428265 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/wmalosslessdec: Check that padding bits is not more than sample bits

Fixes: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 18817/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5713317180211200

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 185f441b
...@@ -950,6 +950,8 @@ static int decode_subframe(WmallDecodeCtx *s) ...@@ -950,6 +950,8 @@ static int decode_subframe(WmallDecodeCtx *s)
for (j = 0; j < subframe_len; j++) for (j = 0; j < subframe_len; j++)
s->channel_residues[i][j] = get_sbits_long(&s->gb, bits); s->channel_residues[i][j] = get_sbits_long(&s->gb, bits);
} else { } else {
if (s->bits_per_sample < padding_zeroes)
return AVERROR_INVALIDDATA;
for (i = 0; i < s->num_channels; i++) { for (i = 0; i < s->num_channels; i++) {
if (s->is_channel_coded[i]) { if (s->is_channel_coded[i]) {
decode_channel_residues(s, i, subframe_len); decode_channel_residues(s, i, subframe_len);
......
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