From: Loren Merritt Date: Tue, 19 May 2009 02:47:15 +0000 (+0000) Subject: fix a race condition at the end of thread_input X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=303e985d09f6562cf3a52327d30e3120fa481008;p=libx264 fix a race condition at the end of thread_input --- diff --git a/muxers.c b/muxers.c index 2eae1eb3..d62be5cd 100644 --- a/muxers.c +++ b/muxers.c @@ -505,10 +505,10 @@ int read_frame_thread( x264_picture_t *p_pic, hnd_t handle, int i_frame ) int close_file_thread( hnd_t handle ) { thread_input_t *h = handle; - h->p_close_infile( h->p_handle ); - x264_picture_clean( &h->pic ); if( h->in_progress ) x264_pthread_join( h->tid, NULL ); + h->p_close_infile( h->p_handle ); + x264_picture_clean( &h->pic ); free( h->next_args ); free( h ); return 0;