summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2003-09-14 11:04:11 +0000
committerDavid Schleef <ds@schleef.org>2003-09-14 11:04:11 +0000
commitb3e15a8f711f11c3d4d76aa70c64fd5c367aa986 (patch)
tree520f78967b6b5c4080800ad383ac374a43f57ce1
parent3f763b167cbd747567a71df456ae796af39732f9 (diff)
downloadgstreamer-b3e15a8f711f11c3d4d76aa70c64fd5c367aa986.tar.gz
add check for setting pad_get and pad_chain functions on wrong type pads.
Original commit message from CVS: add check for setting pad_get and pad_chain functions on wrong type pads.
-rw-r--r--gst/gstpad.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gst/gstpad.c b/gst/gstpad.c
index a4789db7da..3ad9971e23 100644
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
@@ -471,6 +471,7 @@ gst_pad_set_chain_function (GstPad *pad, GstPadChainFunction chain)
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
+ g_return_if_fail (GST_RPAD_DIRECTION (pad) == GST_PAD_SINK);
GST_RPAD_CHAINFUNC (pad) = chain;
GST_CAT_DEBUG (GST_CAT_PADS, "chainfunc for %s:%s set to %s",
@@ -490,6 +491,7 @@ gst_pad_set_get_function (GstPad *pad,
{
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_REAL_PAD (pad));
+ g_return_if_fail (GST_RPAD_DIRECTION (pad) == GST_PAD_SRC);
GST_RPAD_GETFUNC (pad) = get;
@@ -509,6 +511,7 @@ gst_pad_set_event_function (GstPad *pad,
GstPadEventFunction event)
{
g_return_if_fail (GST_IS_REAL_PAD (pad));
+ g_return_if_fail (GST_RPAD_DIRECTION (pad) == GST_PAD_SRC);
GST_RPAD_EVENTFUNC (pad) = event;