avformat/matroskadec: Check for EOF in resync loop

Fixes: Timeout (too long -> instantly)
Fixes: 29136/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-4586141227548672

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2021-01-29 21:18:36 +01:00
parent 0f441b9063
commit 5282147d0c
1 changed files with 2 additions and 0 deletions

View File

@ -2953,6 +2953,8 @@ static int matroska_read_header(AVFormatContext *s)
goto fail;
pos = avio_tell(matroska->ctx->pb);
res = ebml_parse(matroska, matroska_segment, matroska);
if (res == AVERROR(EIO)) // EOF is translated to EIO, this exists the loop on EOF
goto fail;
}
/* Set data_offset as it might be needed later by seek_frame_generic. */
if (matroska->current_id == MATROSKA_ID_CLUSTER)