Commit 3144354a authored by Olivier Crête's avatar Olivier Crête 👻 Committed by Wim Taymans
Browse files

tee: Don't crash if there is no source pad

parent 12247a9f
...@@ -664,6 +664,16 @@ gst_tee_handle_data (GstTee * tee, gpointer data, gboolean is_list) ...@@ -664,6 +664,16 @@ gst_tee_handle_data (GstTee * tee, gpointer data, gboolean is_list)
GST_OBJECT_LOCK (tee); GST_OBJECT_LOCK (tee);
pads = GST_ELEMENT_CAST (tee)->srcpads; 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 */ /* special case for just one pad that avoids reffing the buffer */
if (!pads->next) { if (!pads->next) {
GstPad *pad = GST_PAD_CAST (pads->data); GstPad *pad = GST_PAD_CAST (pads->data);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment