Hallå.

Cherry picked this fix from ffmpeg and it fixes bugreport 263

m.v.h.
-- 
Johan Andersson
>From 4b1c7e8243b768fc530788fd5f6bd0c251798af3 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <[email protected]>
Date: Mon, 2 Apr 2012 17:00:20 +0200
Subject: [PATCH] movenc: fix segfault with chapter tracks

Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavformat/movenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 1209b7b..367f3a4 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2839,7 +2839,7 @@ static int mov_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
 
     if (!size) return 0; /* Discard 0 sized packets */
 
-    if (trk->entry)
+    if (trk->entry && pkt->stream_index < s->nb_streams)
         frag_duration = av_rescale_q(pkt->dts - trk->cluster[0].dts,
                                      s->streams[pkt->stream_index]->time_base,
                                      AV_TIME_BASE_Q);
-- 
1.7.9.5

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to