mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-13 17:55:30 +00:00
rtpptdemux: plug pad leak in error code path
Based on patch by: Stig Sandnes <stig.sandnes@cisco.com> Don't leak srcpad if there are no caps. https://bugzilla.gnome.org/show_bug.cgi?id=667820
This commit is contained in:
parent
ffe010ee4d
commit
f10e8192fa
1 changed files with 4 additions and 4 deletions
|
@ -326,6 +326,10 @@ gst_rtp_pt_demux_chain (GstPad * pad, GstBuffer * buf)
|
||||||
GstPadTemplate *templ;
|
GstPadTemplate *templ;
|
||||||
gchar *padname;
|
gchar *padname;
|
||||||
|
|
||||||
|
caps = gst_rtp_pt_demux_get_caps (rtpdemux, pt);
|
||||||
|
if (!caps)
|
||||||
|
goto no_caps;
|
||||||
|
|
||||||
klass = GST_ELEMENT_GET_CLASS (rtpdemux);
|
klass = GST_ELEMENT_GET_CLASS (rtpdemux);
|
||||||
templ = gst_element_class_get_pad_template (klass, "src_%d");
|
templ = gst_element_class_get_pad_template (klass, "src_%d");
|
||||||
padname = g_strdup_printf ("src_%d", pt);
|
padname = g_strdup_printf ("src_%d", pt);
|
||||||
|
@ -334,10 +338,6 @@ gst_rtp_pt_demux_chain (GstPad * pad, GstBuffer * buf)
|
||||||
g_free (padname);
|
g_free (padname);
|
||||||
gst_pad_set_event_function (srcpad, gst_rtp_pt_demux_src_event);
|
gst_pad_set_event_function (srcpad, gst_rtp_pt_demux_src_event);
|
||||||
|
|
||||||
caps = gst_rtp_pt_demux_get_caps (rtpdemux, pt);
|
|
||||||
if (!caps)
|
|
||||||
goto no_caps;
|
|
||||||
|
|
||||||
caps = gst_caps_make_writable (caps);
|
caps = gst_caps_make_writable (caps);
|
||||||
gst_caps_set_simple (caps, "payload", G_TYPE_INT, pt, NULL);
|
gst_caps_set_simple (caps, "payload", G_TYPE_INT, pt, NULL);
|
||||||
gst_pad_set_caps (srcpad, caps);
|
gst_pad_set_caps (srcpad, caps);
|
||||||
|
|
Loading…
Reference in a new issue