diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-11 12:09:08 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-05-19 17:17:35 +0200 |
commit | 913f64e92302ece2874c5368171d0cc32b9f6d0a (patch) | |
tree | dd48707ad93dc6f4bd63f9d98ba89354b0df2d56 | |
parent | 0724e514dc161cbbc05661477090e50f8b4e44fb (diff) | |
download | ffmpeg-913f64e92302ece2874c5368171d0cc32b9f6d0a.tar.gz |
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@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1cd41840208bce7e690a4ccc48077567418a0aa8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/mov.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index a709033abd..feec372a61 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1979,6 +1979,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]; |