GNOME Bugzilla – Bug 758517
spu-pgs: Fix array memory leak
Last modified: 2015-11-24 15:35:31 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)
Created attachment 316067 [details] [review] fix array memory leak
Created attachment 316071 [details] [review] fix array memory leak
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