[x264-devel] Memory Leak in x264/encoder/encoder.c

devel at integra-sc.it devel at integra-sc.it
Tue Oct 13 08:19:38 CEST 2009


Hi all, and congratulations for all your work.
Using the x264 encoder with ffmpeg library, in a loop cycle, 
opening/encoding/closing the codec and testing the code with valgrind, 
we have noticed a memory leak in the function:
void x264_encoder_close ( x264_t *h ).
We have tried to add  the following line before the end of the function:
x264_free( h->nal_buffer );
Attacched the pach, realized by Gennaro Gallo our developer.
Thanks for all.
Vito Covito.
-------------- next part --------------
--- encoder.c.old	2009-10-12 13:38:31.000000000 +0200
+++ encoder.c	2009-10-12 13:35:25.000000000 +0200
@@ -2371,6 +2371,8 @@
         x264_free( h->thread[i]->out.nal);
         x264_free( h->thread[i] );
     }
+
+    x264_free( h->nal_buffer ); // Gennaro Gallo - 12-oct-2009 (13:01) - Memory leak bug ( with ffmpeg on close_codec() )
 }

 /****************************************************************************


More information about the x264-devel mailing list