Commit 03a8f4c8 authored by Anton Mitrofanov's avatar Anton Mitrofanov Committed by Fiona Glaser

Fix memory leak on encoder close if not all frames are flushed

parent 228f57c2
......@@ -3318,6 +3318,12 @@ void x264_encoder_close ( x264_t *h )
h = h->thread[0];
for( int i = 0; i < h->i_thread_frames; i++ )
if( h->thread[i]->b_thread_active )
for( int j = 0; j < h->thread[i]->i_ref[0]; j++ )
if( h->thread[i]->fref[0][j] && h->thread[i]->fref[0][j]->b_duplicate )
x264_frame_delete( h->thread[i]->fref[0][j] );
for( int i = h->param.i_threads - 1; i >= 0; i-- )
{
x264_frame_t **frame;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment