aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-01-20 00:00:27 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-10 16:04:26 +0200
commit6cd5bfe3cdfbc5c85b4946c6f0537195ec9f501b (patch)
treed986b76d94f449177964096eedf2841cf7e6b242
parenta5d1613f48cb55e2fa0e21f72f08d74513d25065 (diff)
downloadffmpeg-6cd5bfe3cdfbc5c85b4946c6f0537195ec9f501b.tar.gz
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@niedermayer.cc> (cherry picked from commit 9e3d09f435f83f9653056b2fecc4d03ac45f3ffd) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/asfdec_o.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 32a7571300..f4d63571c0 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);