diff options
author | David Svensson Fors <davidsf@axis.com> | 2012-06-12 13:26:35 +0200 |
---|---|---|
committer | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2012-06-14 14:09:57 +0100 |
commit | 70a95ff5c78ba9921b2ebb00f56a0cf42822a259 (patch) | |
tree | 0d2b6b63a82b6e984b75342bc4bc6fd839f082a4 | |
parent | 321af1ccb8070e9d4718361c350a56660dab5a7c (diff) | |
download | gstreamer-70a95ff5c78ba9921b2ebb00f56a0cf42822a259.tar.gz |
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
-rw-r--r-- | plugins/elements/gstfunnel.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/elements/gstfunnel.c b/plugins/elements/gstfunnel.c index a874b26071..49c7519855 100644 --- a/plugins/elements/gstfunnel.c +++ b/plugins/elements/gstfunnel.c @@ -256,16 +256,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; } |