summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2009-03-03 18:19:44 +0000
committerAlex Converse <alex.converse@gmail.com>2009-03-03 18:19:44 +0000
commitfefe43ff2c180928348d445abb9696cf2581d953 (patch)
tree7019d19a34cd77f075816fdba761e34871f4c06e /libavformat/mov.c
parentbc8763cda993ef14bf470da3eea174593e3f9bfe (diff)
MOV: fix crash when 'meta' occurs before first 'trak'
Originally committed as revision 17781 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index b34326c3cf..88f8003057 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -308,10 +308,15 @@ static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
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 */