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 564885 - [mpegstream] memory leak
[mpegstream] memory leak
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
git master
Other Linux
: Normal normal
: 0.10.11
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-12-17 17:57 UTC by Yves Lefebvre
Modified: 2009-01-08 08:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for this bug (2.60 KB, patch)
2008-12-17 18:05 UTC, Yves Lefebvre
none Details | Review
update of the previous patch (5.03 KB, patch)
2009-01-07 19:28 UTC, Yves Lefebvre
none Details | Review

Description Yves Lefebvre 2008-12-17 17:57:53 UTC
Using valgrind I found some memory caps leak when using dvddemux (missing unref of caps).

I made patch for my older version of gst-plugins-ugly and port the fix to the HEAD of cvs too. It compile ok but my setup doesn't allow me to test easily on the latest version (however, it is really some missing unref, so nothing complicated)
Comment 1 Yves Lefebvre 2008-12-17 18:05:30 UTC
Created attachment 124874 [details] [review]
patch for this bug
Comment 2 Sebastian Dröge (slomo) 2008-12-18 17:00:09 UTC
The last part of the patch is obviously correct but I'm not sure the others are. str->caps should probably contain the caps of the pad, even after they're set. The memory leak is more caused by the fact, that str->caps gets new caps when something changes without having the old caps unref'd first.

Could you update the patch to unref str->caps before storing new caps there?
Comment 3 Yves Lefebvre 2009-01-07 19:28:58 UTC
Created attachment 125955 [details] [review]
update of the previous patch

you where right, the first part was not correct at all. Here is an update of the patch. It could be possibly simplified by using gst_caps_replace instead of my if/unref in part of the code where a new caps override an existing one. However, I play safe since I don't know this code a lot and doing gst_caps_replace over a null pointer is not good!
Comment 4 Sebastian Dröge (slomo) 2009-01-08 08:18:46 UTC
2009-01-08  Sebastian Dröge  <sebastian.droege@collabora.co.uk>

	Patch by: Yves Lefebvre <ivanohe at abacom dot com>

	* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_get_video_stream),
	(gst_dvd_demux_get_audio_stream),
	(gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_reset):
	* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_init_stream),
	(gst_mpeg_demux_get_video_stream),
	(gst_mpeg_demux_get_audio_stream), (gst_mpeg_demux_reset):
	* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_chain):
	Fix some caps leaks. Fixes bug #564885.