mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-12-24 11:52:06 +08:00
avcodec/notchlc: Check bytes left before reading
Fixes: Use of uninitialized value
Fixes: 71230/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NOTCHLC_fuzzer-4624502095413248
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 b9c7f50c7d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -92,6 +92,9 @@ static int lz4_decompress(AVCodecContext *avctx,
|
||||
} while (current == 255);
|
||||
}
|
||||
|
||||
if (bytestream2_get_bytes_left(gb) < num_literals)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (pos + num_literals < HISTORY_SIZE) {
|
||||
bytestream2_get_buffer(gb, history + pos, num_literals);
|
||||
pos += num_literals;
|
||||
|
||||
Reference in New Issue
Block a user