From ee99cd7037fac8f2c60303fe3f9f32a6278a9191 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Fri, 13 Apr 2018 22:49:43 +0200 Subject: [PATCH] qtmux: Fix leak gst_qt_mux_can_renegotiate () gets called everywhere following that pattern: return gst_qt_mux_can_renegotiate (ref(self)); This means the reference must be released both in the success and failure cases, it was only done in the success case. --- gst/isomp4/gstqtmux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c index 51b8b8dff3..e25799764d 100644 --- a/gst/isomp4/gstqtmux.c +++ b/gst/isomp4/gstqtmux.c @@ -4822,6 +4822,7 @@ gst_qtmux_caps_is_subset_full (GstQTMux * qtmux, GstCaps * subset, return gst_structure_foreach (sub_s, check_field, sup_s); } +/* will unref @qtmux */ static gboolean gst_qt_mux_can_renegotiate (GstQTMux * qtmux, GstPad * pad, GstCaps * caps) { @@ -4845,6 +4846,7 @@ gst_qt_mux_can_renegotiate (GstQTMux * qtmux, GstPad * pad, GstCaps * caps) GST_DEBUG_OBJECT (qtmux, "pad %s accepted renegotiation to %" GST_PTR_FORMAT " from %" GST_PTR_FORMAT, GST_PAD_NAME (pad), caps, current_caps); + gst_object_unref (qtmux); gst_caps_unref (current_caps); return TRUE;