From: SourceForge.net <no...@so...> - 2007-06-12 22:44:11
|
Bugs item #1736157, was opened at 2007-06-12 15:44 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109655&aid=1736157&group_id=9655 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: xine-plugin Group: v1.1.7 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Memory Leak in Vorbis Decoder Initial Comment: In xine_vorbis_decoder.c (1.1.7) / or libvorbis/xine_decoder.c (trunk), the function vorbis_reset will leak. It does a vorbis_block_init on a existing block which may be filled with some memory. The function vorbis_block_init assumes a uninitialized block and basically will zero out the block structure without free'ing any memory that may be allocated by the block. As reported by valgrind: ==21010== 236,320 bytes in 14 blocks are definitely lost in loss record 121 of 121 ==21010== at 0x4905B57: realloc (vg_replace_malloc.c:306) ==21010== by 0x3C1640A0EE: _vorbis_block_ripcord (in /usr/lib64/libvorbis.so.0.3.1) ==21010== by 0x3C1640C8C3: vorbis_synthesis (in /usr/lib64/libvorbis.so.0.3.1) ==21010== by 0x7ACA21E: vorbis_decode_data (xine_vorbis_decoder.c:211) ==21010== by 0x4EDD655: audio_decoder_loop (audio_decoder.c:361) ==21010== by 0x3C19706324: start_thread (in /lib64/libpthread-2.4.so) ==21010== by 0x3C159CBBAC: clone (in /lib64/libc-2.4.so) So before calling vorbis_block_init, we should call vorbis_block_clear: static void vorbis_reset (audio_decoder_t *this_gen) { vorbis_decoder_t *this = (vorbis_decoder_t *) this_gen; if( !this->header_count ) { /* clear block first. block may contain allocated data. */ vorbis_block_clear(&this->vb); vorbis_block_init(&this->vd,&this->vb); } } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109655&aid=1736157&group_id=9655 |