mpegtspacketizer: Don't dereference NULL if we have no PCR yet
authorSebastian Dröge <sebastian@centricular.com>
Thu, 3 Jul 2014 12:15:36 +0000 (14:15 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 3 Jul 2014 12:15:36 +0000 (14:15 +0200)
Can happen sometimes if the duration is requested before we
received enough data with a PCR.

gst/mpegtsdemux/mpegtspacketizer.c

index a02cc4b..7889c7e 100644 (file)
@@ -2118,6 +2118,12 @@ mpegts_packetizer_offset_to_ts (MpegTSPacketizer2 * packetizer,
         packetizer->refoffset;
   } else {
     PCROffsetCurrent *current = pcrtable->current;
+
+    if (!current->group) {
+      PACKETIZER_GROUP_UNLOCK (packetizer);
+      GST_LOG ("No PCR yet");
+      return GST_CLOCK_TIME_NONE;
+    }
     /* If doing progressive read, use current */
     GST_LOG ("Using current group");
     lastpcr = current->group->pcr_offset + current->pending[current->last].pcr;