Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-01-29 23:18:36 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-10 17:04:26 +0300
commitae300bcf66d299fe63fa6e9ef0eae15bc22aa22b (patch)
treecb5378784cd09abf69f92334b26190d6007e8b08 /libavformat/matroskadec.c
parentbb8db0639e017b66a981e6b3cd868c25e7ee2d70 (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> (cherry picked from commit 5282147d0c92ac821e85b93e2db6704f4720e0c1) 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 6394cb439c..1f22eb6285 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2876,6 +2876,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)