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 758517 - spu-pgs: Fix array memory leak
spu-pgs: Fix array memory leak
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other Linux
: Normal normal
: 1.7.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-11-23 02:32 UTC by Vineeth
Modified: 2015-11-24 15:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix array memory leak (820 bytes, patch)
2015-11-23 02:33 UTC, Vineeth
none Details | Review
fix array memory leak (785 bytes, patch)
2015-11-23 04:18 UTC, Vineeth
committed Details | Review

Description Vineeth 2015-11-23 02:32:26 UTC
When flushing the dvdspu, the even though presentation segment is set as 0, using pgs_presentation_segment_set_object_count, the array is still being created resulting in the below memory leak
Adding an extra condition to check if n_objects is != 0 then create the presentation objects

==11169== 40 bytes in 1 blocks are definitely lost in loss record 4,311 of 6,591
==11169==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11169==    by 0x5D29610: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==11169==    by 0x5D3F22D: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==11169==    by 0x5CF8C44: g_array_sized_new (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==11169==    by 0x20F43D8B: pgs_presentation_segment_set_object_count.isra.5 (gstspu-pgs.c:322)
==11169==    by 0x20F44A11: gstspu_pgs_flush (gstspu-pgs.c:799)
==11169==    by 0x20F3EBE8: gst_dvd_spu_flush_spu_info (gstdvdspu.c:270)
==11169==    by 0x20F3EC3A: gst_dvd_spu_clear (gstdvdspu.c:181)
==11169==    by 0x20F408C9: gst_dvd_spu_change_state (gstdvdspu.c:1229)
==11169==    by 0x57C02CC: gst_element_change_state (gstelement.c:2627)
==11169==    by 0x57C0ADB: gst_element_set_state_func (gstelement.c:2581)
==11169==    by 0x579F805: gst_bin_change_state_func (gstbin.c:2414)
Comment 1 Vineeth 2015-11-23 02:33:16 UTC
Created attachment 316067 [details] [review]
fix array memory leak
Comment 2 Vineeth 2015-11-23 04:18:02 UTC
Created attachment 316071 [details] [review]
fix array memory leak
Comment 3 Tim-Philipp Müller 2015-11-24 15:35:01 UTC
Thanks.

commit b328fbe31a4eabf0b399efabfa205ce777cc2676
Author: Vineeth T M <vineeth.tm@samsung.com>
Date:   Mon Nov 23 11:32:13 2015 +0900

    spu-pgs: Fix array memory leak
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758517