mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-23 23:36:57 +00:00
avcodec/g2meet: Check for end of input in jpg_decode_block()
Fixes: Timeout (100sec -> 0.7sec)
Fixes: 8668/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-5174143888130048
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 61dd2e07be
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
a547d59079
commit
c8823d4957
@ -244,6 +244,9 @@ static int jpg_decode_block(JPGContext *c, GetBitContext *gb,
|
||||
const int is_chroma = !!plane;
|
||||
const uint8_t *qmat = is_chroma ? chroma_quant : luma_quant;
|
||||
|
||||
if (get_bits_left(gb) < 1)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
c->bdsp.clear_block(block);
|
||||
dc = get_vlc2(gb, c->dc_vlc[is_chroma].table, 9, 3);
|
||||
if (dc < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user