Commit 1e59071a authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/ac3: Explicitly return to discard large amounts of nonsense bytes

Changes 19sec to 10ms (12559) runtime, 17sec to 177ms (12570)
Fixes: Timeout
Fixes: 12559/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5666516266123264
Fixes: 12561/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5682923041193984
Fixes: 12570/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5194734308425728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 835ab35e
......@@ -1490,6 +1490,8 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
}
if (i >= buf_size)
return AVERROR_INVALIDDATA;
if (i > 10)
return i;
buf += i;
buf_size -= i;
......
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