Browse Source

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 1cd4184020)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.2.3
Michael Niedermayer 5 years ago
parent
commit
913f64e923
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/mov.c

+ 4
- 0
libavformat/mov.c View File

@@ -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];


Loading…
Cancel
Save