aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-06-05 13:15:34 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-06-15 22:31:13 +0200
commit028a0c91487d8cf094239557d66edd57a114057f (patch)
treee04ab5fd0476b54e2a938708dbbd80dc58531157
parent9a53e8572acc54c8f4bb8ca09f312075f88737f9 (diff)
downloadffmpeg-028a0c91487d8cf094239557d66edd57a114057f.tar.gz
avcodec/shorten: Fix undefined shift in fix_bitshift()
Fixes: left shift of negative value -9 Fixes: 8571/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5715966875926528 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 606c7148231404544005c0827b83c165dd6b39a8) 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 f7475b4954..0bd3e1e5f7 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -177,7 +177,7 @@ static void fix_bitshift(ShortenContext *s, int32_t *buffer)
buffer[i] = 0;
} else if (s->bitshift != 0) {
for (i = 0; i < s->blocksize; i++)
- buffer[i] <<= s->bitshift;
+ buffer[i] *= 1 << s->bitshift;
}
}