tsdemux: fix potential crash dereferencing NULL program pointer
authorAndoni Morales Alastruey <ylatuya@gmail.com>
Wed, 17 Oct 2012 23:47:57 +0000 (01:47 +0200)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 18 Oct 2012 16:54:41 +0000 (17:54 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=686358

gst/mpegtsdemux/tsdemux.c

index 0d1edcb..aed805b 100644 (file)
@@ -1499,6 +1499,12 @@ gst_ts_demux_push_pending_data (GstTSDemux * demux, TSDemuxStream * stream)
     goto beach;
   }
 
+  if (G_UNLIKELY (demux->program == NULL)) {
+    GST_LOG_OBJECT (demux, "No program");
+    g_free (stream->data);
+    goto beach;
+  }
+
   if (G_UNLIKELY (stream->need_newsegment))
     calculate_and_push_newsegment (demux, stream);