[x264-devel] libx264 memory leak

Leon Woestenberg leon.woestenberg at gmail.com
Tue Mar 3 16:10:58 CET 2009


Hello,

On Tue, Mar 3, 2009 at 11:19 AM, Jason Garrett-Glaser
<darkshikari at gmail.com> wrote:
> 2009/3/3 191919 <191919 at gmail.com>:
>> I found a memory leak in x264_mb_analyse_load_costs. It keeps some
>> x264_malloc'ed pointer to a global array, but no one remembers to free them
>> in x264_encoder_close.
>>
>
> This is intentional.  Because the arrays are static, if libx264 is
> called multiple times from the same application, it will not need to
> allocate them separately for each process, thus saving memory.
>

Under Unices, using a library constructor/destructor approach is available:

http://www.faqs.org/docs/Linux-HOWTO/Program-Library-HOWTO.html#INIT-AND-CLEANUP

Not sure how Windows handles that though,

Regards,
-- 
Leon


More information about the x264-devel mailing list