Commit caa9b4ff authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/agm: Check that there is available input in read_code()

Fixes: Timeout (46sec -> 7ms)
Fixes: 14030/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5721258760601600

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent d0ca749a
......@@ -103,6 +103,9 @@ static int read_code(GetBitContext *gb, int *oskip, int *level, int *map, int mo
{
int len = 0, skip = 0, max;
if (get_bits_left(gb) < 2)
return AVERROR_INVALIDDATA;
if (show_bits(gb, 2)) {
switch (show_bits(gb, 4)) {
case 1:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment