aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/leaddec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-12-15 02:18:04 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2023-12-29 01:15:42 +0100
commitd909d8e5e0fbce42ecb10ee6e73def1f1e42ece4 (patch)
treeb808cd5ed77c5d1bcd81844a0e4bc1d5a367c7d2 /libavcodec/leaddec.c
parent5f88458bea698e00913a38940a7c34994151d2a8 (diff)
downloadffmpeg-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>
Diffstat (limited to 'libavcodec/leaddec.c')
-rw-r--r--libavcodec/leaddec.c3
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;