diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-01-29 21:18:36 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-09 22:02:20 +0200 |
commit | b2d4f33fd42d177c38ff0b32683c9a1e6bd2c67e (patch) | |
tree | 8e55f4f090b60330ff5b8fc71cba03cb0a03c227 | |
parent | 81e27dc15b36de2442eef584b8a03dcc070491d8 (diff) | |
download | ffmpeg-b2d4f33fd42d177c38ff0b32683c9a1e6bd2c67e.tar.gz |
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>
-rw-r--r-- | libavformat/matroskadec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 448e18a182..f8c10818fa 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -2482,6 +2482,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; } matroska_execute_seekhead(matroska); |