After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 797326 - matroska-demux leaks caps
matroska-demux leaks caps
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-10-23 14:23 UTC by Johan Bjäreholt
Modified: 2018-10-27 09:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (931 bytes, patch)
2018-10-23 14:23 UTC, Johan Bjäreholt
committed Details | Review
patch2 (1.28 KB, patch)
2018-10-24 09:08 UTC, Johan Bjäreholt
committed Details | Review

Description Johan Bjäreholt 2018-10-23 14:23:05 UTC
Created attachment 374012 [details] [review]
patch

The demuxer leaks caps in the new gst_matroska_demux_update_tracks function
Comment 1 Sebastian Dröge (slomo) 2018-10-23 15:11:41 UTC
Review of attachment 374012 [details] [review]:

::: gst/matroska/matroska-demux.c
@@ +3279,3 @@
           gst_pad_set_caps (new_track->pad, new_track->caps);
         }
+        gst_caps_replace (&old_track->caps, NULL);

The gst_matroska_track_free(old_track) a few lines below should unref the caps already, but it doesn't... can you move this code there, and also check if other things would have to be freed there too?
Comment 2 Johan Bjäreholt 2018-10-24 09:08:56 UTC
Created attachment 374025 [details] [review]
patch2

Moved gst_caps_replace to gst_matroska_track_free as you suggested, works fine in my usecase and passes gst-plugins-good unittest with valgrind aswell.

Have not had time to check if there might be other values not getting properly released, might take a look at it after the GStreamer conference.
Comment 3 Sebastian Dröge (slomo) 2018-10-24 09:27:14 UTC
Comment on attachment 374025 [details] [review]
patch2

Great, let's wait until someone had the time to check for other things to be freed then unless it takes too long :)
Comment 4 Sebastian Dröge (slomo) 2018-10-27 09:49:34 UTC
commit e736f29376ad3021ec719621f49c68a15bc30b47 (HEAD -> master)
Author: Johan Bjäreholt <johanbj@axis.com>
Date:   Wed Oct 17 12:58:08 2018 +0200

    matroska-demux: Fix caps memleak
    
    https://bugzilla.gnome.org/show_bug.cgi?id=797326
Comment 5 Sebastian Dröge (slomo) 2018-10-27 09:50:14 UTC
Looked like everything else is handled. thanks!