Commit a711efe9 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/shorten: Fix a negative left shift in shorten_decode_frame()

Fixes: left shift of negative value -9057
Fixes: 8527/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5666853924896768

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent d91a0b50
...@@ -710,7 +710,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data, ...@@ -710,7 +710,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
if (s->version < 2) if (s->version < 2)
s->offset[channel][s->nmean - 1] = sum / s->blocksize; s->offset[channel][s->nmean - 1] = sum / s->blocksize;
else else
s->offset[channel][s->nmean - 1] = s->bitshift == 32 ? 0 : (sum / s->blocksize) << s->bitshift; s->offset[channel][s->nmean - 1] = s->bitshift == 32 ? 0 : (sum / s->blocksize) * (1 << s->bitshift);
} }
/* copy wrap samples for use with next block */ /* copy wrap samples for use with next block */
......
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