aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-01-11 12:09:08 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-30 19:58:45 +0100
commit1cd41840208bce7e690a4ccc48077567418a0aa8 (patch)
tree100d4c75404f4e8f65ff6ae2a265a9ba771eb9f3 /libavformat/mov.c
parent422202516cfb6239abb4e20db9f628f3899a76e2 (diff)
downloadffmpeg-1cd41840208bce7e690a4ccc48077567418a0aa8.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>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c4
1 files changed, 4 insertions, 0 deletions
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];