diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-08-12 23:06:55 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-11-18 02:20:44 +0100 |
commit | c71fe632b74cc0a346f87128ab141c413b5469d0 (patch) | |
tree | 3ce0346982a84f87b9a48cfa556f7798ed90de02 | |
parent | eba99acdf2673c07b43617f60b449f29b0a6177e (diff) | |
download | ffmpeg-c71fe632b74cc0a346f87128ab141c413b5469d0.tar.gz |
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>
(cherry picked from commit 9b604e96a51a1fca92bbabfe4f7ac53f0470ee41)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/shorten.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 17a3cce0df..c1a6df3802 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -701,7 +701,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 */ |