From 6042793c2671253389ef440fe52e92339bfc9446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 4 Nov 2009 17:15:59 +0100 Subject: [PATCH] ghostpad: Make sure that nobody sets the proxypad or ghostpad itself as target Doing this will lead to very interesting crashes, like stack overflows. --- gst/gstghostpad.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gst/gstghostpad.c b/gst/gstghostpad.c index 2eb1a0f24e..e544a02b7b 100644 --- a/gst/gstghostpad.c +++ b/gst/gstghostpad.c @@ -1182,6 +1182,8 @@ gst_ghost_pad_set_target (GstGhostPad * gpad, GstPad * newtarget) GstPadLinkReturn lret; g_return_val_if_fail (GST_IS_GHOST_PAD (gpad), FALSE); + g_return_val_if_fail (GST_PAD_CAST (gpad) != newtarget, FALSE); + g_return_val_if_fail (newtarget != GST_PROXY_PAD_INTERNAL (gpad), FALSE); /* no need for locking, the internal pad's lifecycle is directly linked to the * ghostpad's */