GNOME Bugzilla – Bug 759522
pnmdec: Fix memory leaks
Last modified: 2015-12-16 08:58:48 UTC
When launching example pipelines with valgrind, for a corrupted file generated using pnmenc(without patches in 759520), get memory leaks.
Created attachment 317468 [details] [review] fix buffer leak This handles buffer leak for corrupted files. ==4080== 77,043 (160 direct, 76,883 indirect) bytes in 1 blocks are definitely lost in loss record 2,285 of 2,286 ==4080== at 0x402C17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==4080== by 0x421CBE2: g_malloc (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0) ==4080== by 0x4233281: g_slice_alloc (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0) ==4080== by 0x406807B: gst_buffer_new (gstbuffer.c:714) ==4080== by 0x40691C4: gst_buffer_new_allocate (gstbuffer.c:762) ==4080== by 0x4161577: gst_pnmdec_parse (gstpnmdec.c:376) ==4080== by 0x61D1116: gst_video_decoder_parse_available (gstvideodecoder.c:1005) ==4080== by 0x61D12C3: gst_video_decoder_chain_forward (gstvideodecoder.c:2198) ==4080== by 0x61D351D: gst_video_decoder_chain (gstvideodecoder.c:2494) ==4080== by 0x40A2BA7: gst_pad_push_data (gstpad.c:4153) ==4080== by 0x40AB866: gst_pad_push (gstpad.c:4524) ==4080== by 0x61675A2: gst_base_src_loop (gstbasesrc.c:2845)
Created attachment 317469 [details] [review] Fix scanner leak This handles scanner leak for corrupted files. ==4080== 236 (92 direct, 144 indirect) bytes in 1 blocks are definitely lost in loss record 2,229 of 2,286 ==4080== at 0x402E109: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==4080== by 0x421CC4A: g_malloc0 (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0) ==4080== by 0x422CB3B: g_scanner_new (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0) ==4080== by 0x4161407: gst_pnmdec_parse (gstpnmdec.c:182) ==4080== by 0x61D1116: gst_video_decoder_parse_available (gstvideodecoder.c:1005) ==4080== by 0x61D12C3: gst_video_decoder_chain_forward (gstvideodecoder.c:2198) ==4080== by 0x61D351D: gst_video_decoder_chain (gstvideodecoder.c:2494) ==4080== by 0x40A2BA7: gst_pad_push_data (gstpad.c:4153) ==4080== by 0x40AB866: gst_pad_push (gstpad.c:4524) ==4080== by 0x61675A2: gst_base_src_loop (gstbasesrc.c:2845) ==4080== by 0x40D9EA8: gst_task_func (gsttask.c:331) ==4080== by 0x40DB04E: default_func (gsttaskpool.c:68)
commit 7c65a5ccd5bafc35a5ff4920385611e5edc003a7 Author: Vineeth TM <vineeth.tm@samsung.com> Date: Wed Dec 16 13:08:22 2015 +0900 pnmdec: Fix scanner memory leak For corrupted files, scanner memory is being leaked. https://bugzilla.gnome.org/show_bug.cgi?id=759522 commit 319d9efb2d2f1aa1f5aa4b5490ef6eee06c4b2bf Author: Vineeth TM <vineeth.tm@samsung.com> Date: Wed Dec 16 13:06:45 2015 +0900 pnmdec: Fix buffer memory leak In case of corrupted file, s->buf allocated is not being freed https://bugzilla.gnome.org/show_bug.cgi?id=759522