mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-23 04:24:35 +02:00
avcodec/shorten: Fix signed 32bit overflow in shift in shorten_decode_frame()
Fixes: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Fixes: 9480/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-6647324284551168 -rss_limit_mb=2000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
db7e9082e1
commit
9b604e96a5
@ -715,7 +715,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
|
||||
if (s->version < 2)
|
||||
s->offset[channel][s->nmean - 1] = sum / s->blocksize;
|
||||
else
|
||||
s->offset[channel][s->nmean - 1] = s->bitshift == 32 ? 0 : (sum / s->blocksize) * (1 << s->bitshift);
|
||||
s->offset[channel][s->nmean - 1] = s->bitshift == 32 ? 0 : (sum / s->blocksize) * (1LL << s->bitshift);
|
||||
}
|
||||
|
||||
/* copy wrap samples for use with next block */
|
||||
|
Loading…
x
Reference in New Issue
Block a user