From 6d19fd5c26cc2971a9925376f52e57c286d2326b Mon Sep 17 00:00:00 2001
From: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Date: Tue, 28 Sep 2010 00:33:21 +0000
Subject: [PATCH] In mov demuxer, check that nb_streams is valid before using
 it in read_dac3

Originally committed as revision 25240 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavformat/mov.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index fdf297096e0..89fad78de36 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -567,6 +567,8 @@ static int mov_read_dac3(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     AVStream *st;
     int ac3info, acmod, lfeon;
 
+    if (c->fc->nb_streams < 1)
+        return 0;
     st = c->fc->streams[c->fc->nb_streams-1];
 
     ac3info = get_be24(pb);
-- 
GitLab