Mercurial > libavformat.hg
diff mov.c @ 4642:60d5f0997351 libavformat
MOV: fix crash when 'meta' occurs before first 'trak'
author | alexc |
---|---|
date | Tue, 03 Mar 2009 18:19:44 +0000 |
parents | 29c799c20735 |
children | 774c340b9e41 |
line wrap: on
line diff
--- a/mov.c Tue Mar 03 17:06:18 2009 +0000 +++ b/mov.c Tue Mar 03 18:19:44 2009 +0000 @@ -308,10 +308,15 @@ static int mov_read_hdlr(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { - AVStream *st = c->fc->streams[c->fc->nb_streams-1]; + AVStream *st; uint32_t type; uint32_t ctype; + if (c->fc->nb_streams < 1) // meta before first trak + return 0; + + st = c->fc->streams[c->fc->nb_streams-1]; + get_byte(pb); /* version */ get_be24(pb); /* flags */