diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-03-30 20:49:29 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-03-30 20:49:29 +0000 |
commit | 44e43aab036595a8f6d78c9306864d00f35ebbb1 (patch) | |
tree | 825b14c03e6231bfa81be3bbe67e985aed49aa9c /libavformat/mov.c | |
parent | 3a027f5e669c0c6363d960c585f52a6957e03b39 (diff) | |
download | ffmpeg-44e43aab036595a8f6d78c9306864d00f35ebbb1.tar.gz |
check frag track id before setting st
Originally committed as revision 12634 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index a19e97093a..0c232e6de3 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1442,14 +1442,18 @@ static int mov_read_trex(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) static int mov_read_trun(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) { MOVFragment *frag = &c->fragment; - AVStream *st = c->fc->streams[frag->track_id-1]; - MOVStreamContext *sc = st->priv_data; + AVStream *st; + MOVStreamContext *sc; uint64_t offset; int64_t dts; int data_offset = 0; unsigned entries, first_sample_flags = frag->flags; int flags, distance, i; + if (!frag->track_id || frag->track_id > c->fc->nb_streams) + return -1; + st = c->fc->streams[frag->track_id-1]; + sc = st->priv_data; if (sc->pseudo_stream_id+1 != frag->stsd_id) return 0; if (!st->nb_index_entries) |