Fix segfault caused by last checkin
authorDavid Schleef <ds@schleef.org>
Tue, 30 Dec 2003 19:11:03 +0000 (19:11 +0000)
committerDavid Schleef <ds@schleef.org>
Tue, 30 Dec 2003 19:11:03 +0000 (19:11 +0000)
Original commit message from CVS:
Fix segfault caused by last checkin

ChangeLog
gst/gstpad.c

index 0798135..556cac7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-12-30  David Schleef  <ds@schleef.org>
+
+       * gst/gstpad.c: (gst_pad_link_try):
+         Fix segfault when attempting to return to old caps
+
 2003-12-29  David Schleef  <ds@schleef.org>
 
        * gst/gstcaps.c: (gst_caps_normalize), (simplify_foreach),
index caa68bd..2dedd5d 100644 (file)
@@ -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;
   }