From c1a3f958e7bbebdcea753d875a502fdb061b721a Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Wed, 17 Nov 2021 17:27:13 +1100 Subject: [PATCH] rtpptdemux: fix leak of caps when ignoring a pt Part-of: --- subprojects/gst-plugins-good/gst/rtpmanager/gstrtpptdemux.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpptdemux.c b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpptdemux.c index e588a3fa21..6759e69122 100644 --- a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpptdemux.c +++ b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpptdemux.c @@ -477,8 +477,12 @@ gst_rtp_pt_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) if (!caps) goto no_caps; - if (gst_rtp_pt_demux_pt_is_ignored (rtpdemux, pt)) + /* must be after the get_caps() call as get_caps() may cause external code + * (e.g. rtpbin) to update the ignored-pt list */ + if (gst_rtp_pt_demux_pt_is_ignored (rtpdemux, pt)) { + gst_clear_caps (&caps); goto ignored; + } klass = GST_ELEMENT_GET_CLASS (rtpdemux); templ = gst_element_class_get_pad_template (klass, "src_%u");