summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>2009-12-22 15:29:26 -0500
committerWim Taymans <wim@metal.(none)>2009-12-22 22:31:06 +0100
commit3144354aae09b003008ac8f5e92ec1a9e1a22882 (patch)
tree6e7837a126b59e43724ababa9885135dc8979d78
parent12247a9f9b09c1054e668ff617a51bc1687b5fc4 (diff)
tee: Don't crash if there is no source pad
-rw-r--r--plugins/elements/gsttee.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c
index 7a3bf1df1c..cd594670a1 100644
--- a/plugins/elements/gsttee.c
+++ b/plugins/elements/gsttee.c
@@ -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);