From 0cd21ddaed5bd9e55fd4bb46f0a9e101b631cfc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= Date: Wed, 21 Dec 2011 11:58:01 +0100 Subject: [PATCH] mxfdec: Zero nb_ptses in mxf_compute_ptses_fake_index() This fixes SIGSEGV on files with both CBR and VBR index segments (zzuf6.mxf). --- libavformat/mxfdec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 15c2a21e1d..50dc3a8053 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -1028,8 +1028,10 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta for (i = 0; i < index_table->nb_segments; i++) { MXFIndexTableSegment *s = index_table->segments[i]; - if (!s->nb_index_entries) + if (!s->nb_index_entries) { + index_table->nb_ptses = 0; return 0; /* no TemporalOffsets */ + } index_table->nb_ptses += s->index_duration; }