From 1933a78c8e1408e2beda362a23f9d34cdec7dc33 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 30 Dec 2003 19:11:03 +0000 Subject: [PATCH] Fix segfault caused by last checkin Original commit message from CVS: Fix segfault caused by last checkin --- ChangeLog | 5 +++++ gst/gstpad.c | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0798135..556cac7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-12-30 David Schleef + + * gst/gstpad.c: (gst_pad_link_try): + Fix segfault when attempting to return to old caps + 2003-12-29 David Schleef * gst/gstcaps.c: (gst_caps_normalize), (simplify_foreach), diff --git a/gst/gstpad.c b/gst/gstpad.c index caa68bd..2dedd5d 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -1205,10 +1205,13 @@ gst_pad_link_try (GstPadLink *link) ret = gst_pad_link_negotiate (link); if (ret == GST_PAD_LINK_REFUSED) { - oldlink->srcnotify = link->srcnotify; - oldlink->sinknotify = link->sinknotify; - if (oldlink && oldlink->caps && !gst_pad_link_call_link_functions (oldlink)) - g_warning ("pads don't accept old caps. We assume they did though"); + if (oldlink && oldlink->caps) { + oldlink->srcnotify = link->srcnotify; + oldlink->sinknotify = link->sinknotify; + if (!gst_pad_link_call_link_functions (oldlink)) { + g_warning ("pads don't accept old caps. We assume they did though"); + } + } gst_pad_link_free (link); return ret; } -- 2.7.4