]> git.sesse.net Git - x264/commitdiff
Catch incorrect usage of libx264 API for delayed frames flushing
authorAnton Mitrofanov <BugMaster@narod.ru>
Tue, 21 Apr 2015 20:08:19 +0000 (23:08 +0300)
committerHenrik Gramner <henrik@gramner.com>
Sun, 24 May 2015 09:34:40 +0000 (11:34 +0200)
encoder/encoder.c

index edc387cb95c8b8d7fbb8ff208d8f4eb97917da28..9323b38a2906a82edb951123265e1cf8596c7a85 100644 (file)
@@ -3238,6 +3238,12 @@ int     x264_encoder_encode( x264_t *h,
     /* ------------------- Setup new frame from picture -------------------- */
     if( pic_in != NULL )
     {
+        if( h->lookahead->b_exit_thread )
+        {
+            x264_log( h, X264_LOG_ERROR, "lookahead thread is already stopped\n" );
+            return -1;
+        }
+
         /* 1: Copy the picture to a frame and move it to a buffer */
         x264_frame_t *fenc = x264_frame_pop_unused( h, 0 );
         if( !fenc )