[FFmpeg-cvslog] avformat/mov: Check STCO location

Michael Niedermayer git at videolan.org
Fri Jan 31 01:14:04 EET 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Jan 11 12:09:08 2020 +0100| [1cd41840208bce7e690a4ccc48077567418a0aa8] | committer: Michael Niedermayer

avformat/mov: Check STCO location

Fixes: bypassing of checks and assertion failure
Fixes: asan_1003879.mp4

Found-by: Clusterfuzz + asan
Reported-by: Thomas Guilbert <tguilbert at google.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/mov.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 3a183ed015..bbaf266a4b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1978,6 +1978,10 @@ static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     MOVStreamContext *sc;
     unsigned int i, entries;
 
+    if (c->trak_index < 0) {
+        av_log(c->fc, AV_LOG_WARNING, "STCO outside TRAK\n");
+        return 0;
+    }
     if (c->fc->nb_streams < 1)
         return 0;
     st = c->fc->streams[c->fc->nb_streams-1];



More information about the ffmpeg-cvslog mailing list