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 623172 - [jpegdec] leak in unit test
[jpegdec] leak in unit test
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal blocker
: 0.10.24
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-29 22:18 UTC by Tim-Philipp Müller
Modified: 2010-07-02 17:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tentative patch (2.32 KB, patch)
2010-06-29 22:25 UTC, Tim-Philipp Müller
committed Details | Review

Description Tim-Philipp Müller 2010-06-29 22:18:57 UTC
~/gst/git/gst-plugins-good/tests/check $ make pipelines/simple-launch-lines.valgrind
...

==4143== 59,984 bytes in 5 blocks are definitely lost in loss record 2,503 of 2,506
==4143==    at 0x4C244E8: malloc (vg_replace_malloc.c:236)
==4143==    by 0x6185504: g_malloc (gmem.c:132)
==4143==    by 0x85EAF4B: gst_adapter_take (gstadapter.c:586)
==4143==    by 0x8A78E82: gst_jpeg_dec_fill_input_buffer (gstjpegdec.c:218)
==4143==    by 0x8A7A51E: gst_jpeg_dec_chain (gstjpegdec.c:1193)
==4143==    by 0x5093F8C: gst_pad_chain_data_unchecked (gstpad.c:4176)
==4143==    by 0x509484D: gst_pad_push_data (gstpad.c:4405)
==4143==    by 0x8A77577: gst_jpegenc_term_destination (gstjpegenc.c:251)
==4143==    by 0x8E90C2E: jpeg_finish_compress (jcapimin.c:178)
==4143==    by 0x8A7843C: gst_jpegenc_chain (gstjpegenc.c:631)
==4143==    by 0x5093F8C: gst_pad_chain_data_unchecked (gstpad.c:4176)
==4143==    by 0x509484D: gst_pad_push_data (gstpad.c:4405)
==4143==    by 0x85FD660: gst_base_src_loop (gstbasesrc.c:2487)
==4143==    by 0x50BDAEA: gst_task_func (gsttask.c:271)
==4143==    by 0x61A752E: g_thread_pool_thread_proxy (gthreadpool.c:315)
==4143==    by 0x61A56E3: g_thread_create_proxy (gthread.c:1893)
==4143==    by 0x64208B9: start_thread (pthread_create.c:300)
==4143==
Comment 1 Tim-Philipp Müller 2010-06-29 22:25:51 UTC
Created attachment 164928 [details] [review]
tentative patch

Possible patch. Not very elegant. Maybe there's a better way or I misread the code.
Comment 2 Sebastian Dröge (slomo) 2010-07-02 12:59:45 UTC
Comment on attachment 164928 [details] [review]
tentative patch

Looks good to me, might not be optimal but it's correct at least.

This can still be improved later
Comment 3 Tim-Philipp Müller 2010-07-02 17:16:47 UTC
commit 7cbfe3eae1c5daf7817a76e787c0ef3a63b26f21
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Tue Jun 29 23:18:23 2010 +0100

    jpegdec: fix memory leak
    
    Don't leak result of gst_adapter_take(). There are most likely
    smarter things we can do, but let's keep things simple for the
    release.
    
    Fixes #623172.