OSDN Git Service

mxfdec: Zero nb_ptses in mxf_compute_ptses_fake_index()
authorTomas Härdin <tomas.hardin@codemill.se>
Thu, 26 Jan 2012 12:21:40 +0000 (13:21 +0100)
committerDiego Biurrun <diego@biurrun.de>
Thu, 9 Feb 2012 11:54:13 +0000 (12:54 +0100)
This fixes SIGSEGV on files with both CBR and VBR index segments (zzuf6.mxf).

Signed-off-by: Diego Biurrun <diego@biurrun.de>
libavformat/mxfdec.c

index 582c120..25d8c2b 100644 (file)
@@ -1056,8 +1056,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;
     }