element: Add guard to gst_element_release_pad() to ensure the pad belongs to this element

It's a programming error to pass other pads here, and it easily causes
crashes or other problematic behaviour down the road as subclasses
usually assume to only get their pads.
This commit is contained in:
Sebastian Dröge 2016-12-22 12:05:56 +02:00
parent a5246f91af
commit 597e43cffc

View file

@ -345,6 +345,7 @@ gst_element_release_request_pad (GstElement * element, GstPad * pad)
g_return_if_fail (GST_PAD_PAD_TEMPLATE (pad) == NULL ||
GST_PAD_TEMPLATE_PRESENCE (GST_PAD_PAD_TEMPLATE (pad)) ==
GST_PAD_REQUEST);
g_return_if_fail (GST_PAD_PARENT (pad) == element);
oclass = GST_ELEMENT_GET_CLASS (element);