GNOME Bugzilla – Bug 168133
[PATCH] [jpegenc] Memory leaks
Last modified: 2005-02-22 12:04:24 UTC
valgrind --num-callers=10 --leak-check=yes gst-launch-0.8 videotestsrc ! video/x-raw-rgb,width=320,height=240 ! ffmpegcolorspace ! jpegenc ! fakesink ==8094== 84 bytes in 1 blocks are definitely lost in loss record 7 of 23 ==8094== at 0x1B904EDD: malloc (vg_replace_malloc.c:131) ==8094== by 0x1C48C20D: jinit_memory_mgr (in /usr/local/lib/gstreamer-0.8/libgstjpeg.so) ==8094== by 0x1C47376D: jpeg_CreateCompress (in /usr/local/lib/gstreamer-0.8/libgstjpeg.so) ==8094== by 0x1C4701D1: gst_jpegenc_init (gstjpegenc.c:213) ==8094== by 0x1BC1AA59: g_type_create_instance (gtype.c:1596) ==8094== by 0x1BC078FE: ??? (gobject.c:1045) ==8094== by 0x1B930C17: gst_object_constructor (gstobject.c:197) ==8094== by 0x1BC070CD: g_object_newv (gobject.c:942) ==8094== by 0x1BC0789A: g_object_new_valist (gobject.c:985) ==8094== by 0x1BC06DBA: g_object_new (gobject.c:823) ==24109== 21616 bytes in 73 blocks are definitely lost in loss record 86 of 99 ==24109== at 0x1B904EDD: malloc (vg_replace_malloc.c:131) ==24109== by 0x1B905986: realloc (vg_replace_malloc.c:189) ==24109== by 0x1B970960: g_realloc (gmem.c:170) ==24109== by 0x1CC9E2EA: gst_jpegenc_resync (gstjpegenc.c:333) ==24109== by 0x1CC9E1C6: gst_jpegenc_link (gstjpegenc.c:285) ==24109== by 0x1BB810C4: gst_pad_link_call_link_functions (gstpad.c:1343) ==24109== by 0x1BB8157A: gst_pad_link_try (gstpad.c:1410) ==24109== by 0x1C6EC2CE: gst_ffmpegcsp_chain (gstffmpegcolorspace.c:386) ==24109== by 0x1BB8AAE0: gst_pad_call_chain_function (gstpad.c:4496) ==24109== by 0x1BB87A64: gst_pad_push (gstpad.c:3298) ==24109== by 0x1CDCEB60: gst_pixbufscale_chain (pixbufscale.c:418) ==24109== by 0x1BB8AAE0: gst_pad_call_chain_function (gstpad.c:4496) ==24109== by 0x1BB87A64: gst_pad_push (gstpad.c:3298) ==24109== by 0x1C6EC2BB: gst_ffmpegcsp_chain (gstffmpegcolorspace.c:389) ==24109== by 0x1BB8AAE0: gst_pad_call_chain_function (gstpad.c:4496) ==24109== (okok, the output is not from the command line above! i've lost gnome-terminal buffer and i've pasted old logs..)
Created attachment 37767 [details] [review] free jpegenc->line[0,1,2] destroy jpegenc->cinfo
Applied with changes, thanks. (used finalize function instead of dispose, because dispose may be called multiple times and I'm not sure whether it's safe to call jpeg_destroy_compress() on an already destroyed context; also merged those two three-line functions directly into the state_change function). Cheers -Tim