From 597e43cffc35b54bd09e3b75fb6dff6c09b3f810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 22 Dec 2016 12:05:56 +0200 Subject: [PATCH] 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. --- gst/gstelement.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gst/gstelement.c b/gst/gstelement.c index 4ff9c67acc..a7aa591629 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -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);