summaryrefslogtreecommitdiff
path: root/libavformat/matroskadec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-01-29 21:18:36 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-03-15 22:24:31 +0100
commit5282147d0c92ac821e85b93e2db6704f4720e0c1 (patch)
tree5b74dbfb632ff1a9015964bf5aaf4ba5503f20f7 /libavformat/matroskadec.c
parent0f441b9063281d8ef5d4c30b10379d08aad8924f (diff)
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>
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r--libavformat/matroskadec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 25eca5825e..fa5f3d9c02 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -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)