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>
release/7.1
Michael Niedermayer 3 months ago
parent 01910ca603
commit b9c7f50c7d
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 3
      libavcodec/notchlc.c

@ -93,6 +93,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;

Loading…
Cancel
Save