[FFmpeg-cvslog] avformat/asfdec_o: Check for EOF in asf_read_marker()

Michael Niedermayer git at videolan.org
Mon Jan 25 02:10:35 EET 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Jan 20 00:00:27 2021 +0100| [9e3d09f435f83f9653056b2fecc4d03ac45f3ffd] | committer: Michael Niedermayer

avformat/asfdec_o: Check for EOF in asf_read_marker()

Fixes: Timeout
Fixes: 26460/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-5710884393189376

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9e3d09f435f83f9653056b2fecc4d03ac45f3ffd
---

 libavformat/asfdec_o.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 6ce5a3fb43..3729adee2f 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -245,6 +245,9 @@ static int asf_read_marker(AVFormatContext *s, const GUIDParseTable *g)
         avio_skip(pb, 4); // flags
         len = avio_rl32(pb);
 
+        if (avio_feof(pb))
+            return AVERROR_INVALIDDATA;
+
         if ((ret = avio_get_str16le(pb, len, name,
                                     sizeof(name))) < len)
             avio_skip(pb, len - ret);



More information about the ffmpeg-cvslog mailing list