diff --git a/libavformat/mov.c b/libavformat/mov.c index 9f3e2a8688..8ca2e90bdb 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1980,6 +1980,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];