diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-11 14:09:08 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-07-01 14:33:44 +0300 |
commit | 0f41c189636d3c1ca02d8f0c81ba981ee7e1e897 (patch) | |
tree | 3bdae4d9a5c16215a24e67ba75859a45822a7976 /libavformat | |
parent | e45920696cfb2809d5364790995503cec23e3715 (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')
-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 5f25e47c09..e04505043d 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1971,6 +1971,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]; |