summaryrefslogtreecommitdiff
path: root/gst/mpegtsdemux
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-07-03 14:15:36 +0200
committerSebastian Dröge <sebastian@centricular.com>2014-07-03 14:15:36 +0200
commitaa6ee772978b24867d0ade9d80837a91912d8415 (patch)
tree742831b85223221395221e54461b0fec9dfe992a /gst/mpegtsdemux
parentc103f7134be9b0a1036a9451dc6acebab0f6b3e3 (diff)
mpegtspacketizer: Don't dereference NULL if we have no PCR yet
Can happen sometimes if the duration is requested before we received enough data with a PCR.
Diffstat (limited to 'gst/mpegtsdemux')
-rw-r--r--gst/mpegtsdemux/mpegtspacketizer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gst/mpegtsdemux/mpegtspacketizer.c b/gst/mpegtsdemux/mpegtspacketizer.c
index a02cc4bc1..7889c7e60 100644
--- a/gst/mpegtsdemux/mpegtspacketizer.c
+++ b/gst/mpegtsdemux/mpegtspacketizer.c
@@ -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;