From: David Svensson Fors Date: Tue, 12 Jun 2012 11:26:35 +0000 (+0200) Subject: gstfunnel: avoid access of freed pad X-Git-Tag: RELEASE-0.11.93~332 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=066b515985897495cae32fca5b7eeeec260c40c9;p=platform%2Fupstream%2Fgstreamer.git gstfunnel: avoid access of freed pad Save the value of the pad's got_eos in gst_funnel_release_pad, before calling gst_element_remove_pad. This is because gst_element_remove_pad may free the pad. https://bugzilla.gnome.org/show_bug.cgi?id=678017 --- diff --git a/plugins/elements/gstfunnel.c b/plugins/elements/gstfunnel.c index a15a9e6..fb4fafe 100644 --- a/plugins/elements/gstfunnel.c +++ b/plugins/elements/gstfunnel.c @@ -229,16 +229,19 @@ gst_funnel_release_pad (GstElement * element, GstPad * pad) { GstFunnel *funnel = GST_FUNNEL (element); GstFunnelPad *fpad = GST_FUNNEL_PAD_CAST (pad); + gboolean got_eos; gboolean send_eos = FALSE; GST_DEBUG_OBJECT (funnel, "releasing pad"); gst_pad_set_active (pad, FALSE); + got_eos = fpad->got_eos; + gst_element_remove_pad (GST_ELEMENT_CAST (funnel), pad); GST_OBJECT_LOCK (funnel); - if (!fpad->got_eos && gst_funnel_all_sinkpads_eos_unlocked (funnel)) { + if (!got_eos && gst_funnel_all_sinkpads_eos_unlocked (funnel)) { GST_DEBUG_OBJECT (funnel, "Pad removed. All others are EOS. Sending EOS"); send_eos = TRUE; }