tee: Don't crash if there is no source pad
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>
Tue, 22 Dec 2009 20:29:26 +0000 (15:29 -0500)
committerWim Taymans <wim@metal.(none)>
Tue, 22 Dec 2009 21:31:06 +0000 (22:31 +0100)
plugins/elements/gsttee.c

index 7a3bf1d..cd59467 100644 (file)
@@ -664,6 +664,16 @@ gst_tee_handle_data (GstTee * tee, gpointer data, gboolean is_list)
   GST_OBJECT_LOCK (tee);
   pads = GST_ELEMENT_CAST (tee)->srcpads;
 
+  /* special case for zero pads */
+  if (!pads) {
+    GST_OBJECT_UNLOCK (tee);
+    if (is_list)
+      gst_buffer_list_unref (data);
+    else
+      gst_buffer_unref (data);
+    return GST_FLOW_NOT_LINKED;
+  }
+
   /* special case for just one pad that avoids reffing the buffer */
   if (!pads->next) {
     GstPad *pad = GST_PAD_CAST (pads->data);