Commit 1cd41840 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mov: Check STCO location

Fixes: bypassing of checks and assertion failure
Fixes: asan_1003879.mp4

Found-by: Clusterfuzz + asan
Reported-by: 's avatarThomas Guilbert <tguilbert@google.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 42220251
......@@ -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];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment