mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 05:01:23 +00:00
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:
parent
a5246f91af
commit
597e43cffc
1 changed files with 1 additions and 0 deletions
|
@ -345,6 +345,7 @@ gst_element_release_request_pad (GstElement * element, GstPad * pad)
|
||||||
g_return_if_fail (GST_PAD_PAD_TEMPLATE (pad) == NULL ||
|
g_return_if_fail (GST_PAD_PAD_TEMPLATE (pad) == NULL ||
|
||||||
GST_PAD_TEMPLATE_PRESENCE (GST_PAD_PAD_TEMPLATE (pad)) ==
|
GST_PAD_TEMPLATE_PRESENCE (GST_PAD_PAD_TEMPLATE (pad)) ==
|
||||||
GST_PAD_REQUEST);
|
GST_PAD_REQUEST);
|
||||||
|
g_return_if_fail (GST_PAD_PARENT (pad) == element);
|
||||||
|
|
||||||
oclass = GST_ELEMENT_GET_CLASS (element);
|
oclass = GST_ELEMENT_GET_CLASS (element);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue