From c8e9cf962cad86449e4dc413ac1a892805c48361 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 15 Sep 2015 12:17:19 +0200 Subject: [PATCH] nle: Avoid unsetting srcpad target after the srcpad is already freed That leaded to segfaults --- plugins/nle/nlesource.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/nle/nlesource.c b/plugins/nle/nlesource.c index fcb98506f0..681e8f6580 100644 --- a/plugins/nle/nlesource.c +++ b/plugins/nle/nlesource.c @@ -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");