aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-06-05 13:12:54 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-07-08 19:45:47 +0200
commite2207d5c46480679b51e00a4ba306d1d733a3418 (patch)
tree623ab36b76841c41cca3319d34128e91746ea8bb
parent9b1cbcdafb71617defbedf3ae7bef9b538a9d0e8 (diff)
downloadffmpeg-e2207d5c46480679b51e00a4ba306d1d733a3418.tar.gz
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/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit a711efe922b2bf1d363bdf7f8357656c3e35021e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/shorten.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index f9e3c6caca..4a5d967300 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -696,7 +696,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) << 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 */