matroska-demux: Fix caps memleak
authorJohan Bjäreholt <johanbj@axis.com>
Wed, 17 Oct 2018 10:58:08 +0000 (12:58 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 27 Oct 2018 09:48:38 +0000 (10:48 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=797326

gst/matroska/matroska-demux.c
gst/matroska/matroska-ids.c
gst/matroska/matroska-read-common.c

index b67112c..4318a2f 100644 (file)
@@ -3278,6 +3278,7 @@ gst_matroska_demux_update_tracks (GstMatroskaDemux * demux, GstEbmlRead * ebml)
         if (!gst_caps_is_equal (old_track->caps, new_track->caps)) {
           gst_pad_set_caps (new_track->pad, new_track->caps);
         }
+        gst_caps_replace (&old_track->caps, NULL);
 
         if (!gst_tag_list_is_equal (old_track->tags, new_track->tags)) {
           GST_DEBUG_OBJECT (old_track->pad, "Sending tags %p: %"
index 517956a..5716b45 100644 (file)
@@ -335,6 +335,7 @@ gst_matroska_track_free (GstMatroskaTrackContext * track)
   g_free (track->language);
   g_free (track->codec_priv);
   g_free (track->codec_state);
+  gst_caps_replace (&track->caps, NULL);
 
   if (track->encodings != NULL) {
     int i;
index 1208550..a952e74 100644 (file)
@@ -3289,7 +3289,6 @@ gst_matroska_read_common_reset (GstElement * element,
       if (context->pad != NULL)
         gst_element_remove_pad (element, context->pad);
 
-      gst_caps_replace (&context->caps, NULL);
       gst_matroska_track_free (context);
     }
     g_ptr_array_free (ctx->src, TRUE);