[0.10] gst-plugins-good: isomp4: fix caps leak

Tim Müller tpm at kemper.freedesktop.org
Thu Jan 5 13:25:44 PST 2012


Module: gst-plugins-good
Branch: 0.10
Commit: 1895f0235337cceebefd27de84e6c2bf2592ea11
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=1895f0235337cceebefd27de84e6c2bf2592ea11

Author: Vincent Penquerc'h <vincent.penquerch at collabora.co.uk>
Date:   Thu Jan  5 19:25:33 2012 +0000

isomp4: fix caps leak

---

 gst/isomp4/gstqtmux.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c
index 4c486ac..5e9fcdd 100644
--- a/gst/isomp4/gstqtmux.c
+++ b/gst/isomp4/gstqtmux.c
@@ -2619,7 +2619,6 @@ gst_qt_mux_audio_sink_set_caps (GstPad * pad, GstCaps * caps)
   AtomInfo *ext_atom = NULL;
   gint constant_size = 0;
   const gchar *stream_format;
-  GstCaps *current_caps = NULL;
 
   /* find stream data */
   qtpad = (GstQTPad *) gst_pad_get_element_private (pad);
@@ -2631,10 +2630,14 @@ gst_qt_mux_audio_sink_set_caps (GstPad * pad, GstCaps * caps)
    * the old caps are a subset of the new one (this means upstream
    * added more info to the caps, as both should be 'fixed' caps) */
   if (qtpad->fourcc) {
+    GstCaps *current_caps = NULL;
+    gboolean is_subset;
     g_object_get (pad, "caps", &current_caps, NULL);
     g_assert (caps != NULL);
 
-    if (!gst_qtmux_caps_is_subset_full (qtmux, current_caps, caps)) {
+    is_subset = gst_qtmux_caps_is_subset_full (qtmux, current_caps, caps);
+    gst_caps_unref (current_caps);
+    if (!is_subset) {
       goto refuse_renegotiation;
     }
     GST_DEBUG_OBJECT (qtmux,
@@ -2941,7 +2944,6 @@ gst_qt_mux_video_sink_set_caps (GstPad * pad, GstCaps * caps)
   GList *ext_atom_list = NULL;
   gboolean sync = FALSE;
   int par_num, par_den;
-  GstCaps *current_caps = NULL;
 
   /* find stream data */
   qtpad = (GstQTPad *) gst_pad_get_element_private (pad);
@@ -2953,10 +2955,14 @@ gst_qt_mux_video_sink_set_caps (GstPad * pad, GstCaps * caps)
    * the old caps are a subset of the new one (this means upstream
    * added more info to the caps, as both should be 'fixed' caps) */
   if (qtpad->fourcc) {
+    GstCaps *current_caps = NULL;
+    gboolean is_subset;
     g_object_get (pad, "caps", &current_caps, NULL);
     g_assert (caps != NULL);
 
-    if (!gst_qtmux_caps_is_subset_full (qtmux, current_caps, caps)) {
+    is_subset = gst_qtmux_caps_is_subset_full (qtmux, current_caps, caps);
+    gst_caps_unref (current_caps);
+    if (!is_subset) {
       goto refuse_renegotiation;
     }
     GST_DEBUG_OBJECT (qtmux,



More information about the gstreamer-commits mailing list