ghostpad: Make sure that nobody sets the proxypad or ghostpad itself as target

Doing this will lead to very interesting crashes, like stack overflows.
This commit is contained in:
Sebastian Dröge 2009-11-04 17:15:59 +01:00
parent f425b2711f
commit 6042793c26

View file

@ -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 */