From 1e059731a376aeddd07f7d61bddf0555cd09ef14 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 2 Apr 2012 17:00:20 +0200 Subject: [PATCH] movenc: fix segfault with chapter tracks Signed-off-by: Michael Niedermayer --- libavformat/movenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index dd14a08907..73b6c66e38 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2887,7 +2887,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);