diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-12-15 02:18:04 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-12-29 01:15:42 +0100 |
commit | d909d8e5e0fbce42ecb10ee6e73def1f1e42ece4 (patch) | |
tree | b808cd5ed77c5d1bcd81844a0e4bc1d5a367c7d2 | |
parent | 5f88458bea698e00913a38940a7c34994151d2a8 (diff) | |
download | ffmpeg-d909d8e5e0fbce42ecb10ee6e73def1f1e42ece4.tar.gz |
avcodec/leaddec: Check remaining bits in decode_block()
Fixes: Timeout
Fixes: 64163/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LEAD_fuzzer-6418925835124736
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/leaddec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/leaddec.c b/libavcodec/leaddec.c index ede52fba5a..4e97479b03 100644 --- a/libavcodec/leaddec.c +++ b/libavcodec/leaddec.c @@ -104,6 +104,9 @@ static int decode_block(LeadContext * s, GetBitContext * gb, s->bdsp.clear_block(block); + if (get_bits_left(gb) <= 0) + return AVERROR_INVALIDDATA; + size = get_vlc2(gb, dc_table, dc_bits, 1); if (size < 0) return AVERROR_INVALIDDATA; |