[FFmpeg-devel] [PATCH 1/3] avformat/mov: Disallow FTYP after streams
Michael Niedermayer
michael at niedermayer.cc
Wed Nov 8 04:12:42 EET 2023
Fixes: Assertion !c->fc->nb_streams failed at libavformat/mov.c:7799
Fixes: 63875/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5479178702815232
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavformat/mov.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index e8efccf6ebf..34ca8095c22 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1222,6 +1222,8 @@ static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int ret = ffio_read_size(pb, type, 4);
if (ret < 0)
return ret;
+ if (c->fc->nb_streams)
+ return AVERROR_INVALIDDATA;
if (strcmp(type, "qt "))
c->isom = 1;
--
2.17.1
More information about the ffmpeg-devel
mailing list