GNOME Bugzilla – Bug 757453
avvidenc: Fix frame memory leak
Last modified: 2015-11-03 07:38:33 UTC
When using sample pipeline gst-launch-1.0 videotestsrc num-buffers=20 ! video/x-raw,framerate=25/1 ! avenc_mpeg2video ! mxfmux name=mux ! fakesink found the below memory leak. ==6690== 127,399 (156 direct, 127,243 indirect) bytes in 1 blocks are definitely lost in loss record 3,033 of 3,034 ==6690== at 0x402C17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==6690== by 0x421BBE2: g_malloc (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0) ==6690== by 0x4232281: g_slice_alloc (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0) ==6690== by 0x423279C: g_slice_alloc0 (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0) ==6690== by 0x4CB9E76: gst_video_encoder_chain (gstvideoencoder.c:1338) ==6690== by 0x40A28C7: gst_pad_push_data (gstpad.c:4104) ==6690== by 0x40AB446: gst_pad_push (gstpad.c:4475) ==6690== by 0x656E255: gst_base_transform_chain (gstbasetransform.c:2369) ==6690== by 0x40A28C7: gst_pad_push_data (gstpad.c:4104) ==6690== by 0x40AB446: gst_pad_push (gstpad.c:4475) ==6690== by 0x6566652: gst_base_src_loop (gstbasesrc.c:2845) ==6690== by 0x40D9888: gst_task_func (gsttask.c:331) This is happening because, while handling frame, if encoder needs more data then it just returns GST_FLOW_OK without unref'ing the frame.
Created attachment 314602 [details] [review] fix frame memory leak
Created attachment 314603 [details] [review] fix frame memory leak should be freed when input buffer failed to map as well
commit 2d94a1cbccf517732b3440ae09672959a84a0fe0 Author: Vineeth TM <vineeth.tm@samsung.com> Date: Mon Nov 2 10:00:55 2015 +0900 avvidenc: Fix frame memory leak The frame being passed to handle_frame should be unref'ed in all cases https://bugzilla.gnome.org/show_bug.cgi?id=757453