nle: Avoid unsetting srcpad target after the srcpad is already freed
authorThibault Saunier <tsaunier@gnome.org>
Tue, 15 Sep 2015 10:17:19 +0000 (12:17 +0200)
committerThibault Saunier <tsaunier@gnome.org>
Tue, 15 Sep 2015 10:17:29 +0000 (12:17 +0200)
That leaded to segfaults

plugins/nle/nlesource.c

index fcb9850..681e8f6 100644 (file)
@@ -214,8 +214,9 @@ element_pad_removed_cb (GstElement * element G_GNUC_UNUSED, GstPad * pad,
 
     GST_DEBUG_OBJECT (source, "Clearing up ghostpad");
 
-    nle_object_ghost_pad_set_target (NLE_OBJECT (source), nleobject->srcpad,
-        NULL);
+    if (nleobject->srcpad)
+      nle_object_ghost_pad_set_target (NLE_OBJECT (source), nleobject->srcpad,
+          NULL);
     priv->ghostedpad = NULL;
   } else {
     GST_DEBUG_OBJECT (source, "The removed pad is NOT our controlled pad");