diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-11 14:09:08 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-05-19 18:17:35 +0300 |
commit | 913f64e92302ece2874c5368171d0cc32b9f6d0a (patch) | |
tree | dd48707ad93dc6f4bd63f9d98ba89354b0df2d56 /libavformat/mov.c | |
parent | 0724e514dc161cbbc05661477090e50f8b4e44fb (diff) |
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>
Diffstat (limited to 'libavformat/mov.c')
-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]; |