aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-17 19:18:31 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-09-04 20:26:35 +0200
commita7f6b27e3c3a2106ac21cde3013471e9aec08ad5 (patch)
treeebbcc7634b20ddd1983760fe93dd103218b37feb
parent517fd68acd7e7a5472fa3c42d2f833773fbcb5b3 (diff)
downloadffmpeg-a7f6b27e3c3a2106ac21cde3013471e9aec08ad5.tar.gz
avcodec/ralf: fix undefined shift
Fixes: left shift of negative value -2 Fixes: 16145/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5146671058518016 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 0ee886988e75b3c22cabc2ca0fadcf8e4f787640) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ralf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/ralf.c b/libavcodec/ralf.c
index 619fd7126a..d2d803b0d4 100644
--- a/libavcodec/ralf.c
+++ b/libavcodec/ralf.c
@@ -300,8 +300,8 @@ static int decode_channel(RALFContext *ctx, GetBitContext *gb, int ch,
t = get_vlc2(gb, code_vlc->table, code_vlc->bits, 2);
code1 = t / range2;
code2 = t % range2;
- dst[i] = extend_code(gb, code1, range, 0) << add_bits;
- dst[i + 1] = extend_code(gb, code2, range, 0) << add_bits;
+ dst[i] = extend_code(gb, code1, range, 0) * (1 << add_bits);
+ dst[i + 1] = extend_code(gb, code2, range, 0) * (1 << add_bits);
if (add_bits) {
dst[i] |= get_bits(gb, add_bits);
dst[i + 1] |= get_bits(gb, add_bits);