streamsynchronizer: If we get EOS for an unknown stream just do nothing
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Sun, 31 Oct 2010 18:08:32 +0000 (19:08 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 2 Dec 2010 18:04:28 +0000 (19:04 +0100)
instead of dereferencing NULL pointers. This can happen if the stream
was just removed from the streamsynchronizer in a bad time.

gst/playback/gststreamsynchronizer.c

index 0114a25..9a48ab0 100644 (file)
@@ -472,11 +472,15 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstEvent * event)
 
       GST_STREAM_SYNCHRONIZER_LOCK (self);
       stream = gst_pad_get_element_private (pad);
-      if (stream) {
-        GST_DEBUG_OBJECT (pad, "Have EOS for stream %d", stream->stream_number);
-        stream->is_eos = TRUE;
+      if (!stream) {
+        GST_STREAM_SYNCHRONIZER_UNLOCK (self);
+        GST_WARNING_OBJECT (pad, "EOS for unknown stream");
+        break;
       }
 
+      GST_DEBUG_OBJECT (pad, "Have EOS for stream %d", stream->stream_number);
+      stream->is_eos = TRUE;
+
       seen_data = stream->seen_data;
       srcpad = gst_object_ref (stream->srcpad);