mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-23 15:26:57 +00:00
avcodec/snappy: Sanity check bytestream2_get_levarint()
Fixes: left shift of 79 by 28 places cannot be represented in type 'int'
Fixes: 20202/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5719004081815552
Fixes: 20219/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5641738677125120
Fixes: 20389/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5680721517871104
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 be54da2117
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
876997d462
commit
5e483df01f
@ -39,6 +39,8 @@ static int64_t bytestream2_get_levarint(GetByteContext *gb)
|
||||
|
||||
do {
|
||||
tmp = bytestream2_get_byte(gb);
|
||||
if (shift > 31 || ((tmp & 127LL) << shift) > INT_MAX)
|
||||
return AVERROR_INVALIDDATA;
|
||||
val |= (tmp & 127) << shift;
|
||||
shift += 7;
|
||||
} while (tmp & 128);
|
||||
|
Loading…
Reference in New Issue
Block a user