1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avcodec/ralf: fix undefined shift in extend_code()

Fixes: left shift of negative value -3
Fixes: 16147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5658392722407424

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:
Michael Niedermayer 2019-08-17 19:25:01 +02:00
parent 0ee886988e
commit 4778407ab3

View File

@ -220,7 +220,7 @@ static inline int extend_code(GetBitContext *gb, int val, int range, int bits)
val -= range;
}
if (bits)
val = (val << bits) | get_bits(gb, bits);
val = ((unsigned)val << bits) | get_bits(gb, bits);
return val;
}