[x264-devel] Delete the huge memory leak in x264.

alexander tian tian.alexandertian at gmail.com
Mon Nov 26 08:13:36 CET 2007


Hi, everyone

I found huge memory leak in the x264. There are at least 3 positions which
has memory leak. Such as below:

1. The function "x264_mb_analyse_load_costs" in file "analyse.c". Here only
"malloc" the buffer for the parameter "*p_cost_mv[52]". But not free them in
the end. It should be freed at the function "x264_encoder_close".

2. The parameter "i_refs" in the function "x264_macroblock_cache_end" should
be computed like in the "x264_macroblock_cache_init". Otherwise it will
cause memory leak.

3. Not all the new "x264_frame_t" are deleted at the end of encoding. So it
cause huge memory leak.

I have corrected them. But I am unable to write patch file. So I had to put
my changed project for windows. My way is not the best. Somebody can
reference from it to generate the better way. Please put in your patch file
if you have better ideas.

Thank you very much.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.videolan.org/pipermail/x264-devel/attachments/20071126/50a7cf41/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x264rev661(onlymemleak).7z
Type: application/octet-stream
Size: 268140 bytes
Desc: not available
Url : http://mailman.videolan.org/pipermail/x264-devel/attachments/20071126/50a7cf41/attachment.obj 


More information about the x264-devel mailing list