Commit 2df9d45d authored by Anton Mitrofanov's avatar Anton Mitrofanov Committed by Fiona Glaser
Browse files

Fix crash with sliced threads and input height <= 112

parent e3d31181
...@@ -472,7 +472,6 @@ static int x264_validate_parameters( x264_t *h, int b_open ) ...@@ -472,7 +472,6 @@ static int x264_validate_parameters( x264_t *h, int b_open )
if( h->param.i_threads == X264_THREADS_AUTO ) if( h->param.i_threads == X264_THREADS_AUTO )
h->param.i_threads = x264_cpu_num_processors() * (h->param.b_sliced_threads?2:3)/2; h->param.i_threads = x264_cpu_num_processors() * (h->param.b_sliced_threads?2:3)/2;
h->param.i_threads = x264_clip3( h->param.i_threads, 1, X264_THREAD_MAX );
if( h->param.i_threads > 1 ) if( h->param.i_threads > 1 )
{ {
#if !HAVE_THREAD #if !HAVE_THREAD
...@@ -487,7 +486,8 @@ static int x264_validate_parameters( x264_t *h, int b_open ) ...@@ -487,7 +486,8 @@ static int x264_validate_parameters( x264_t *h, int b_open )
h->param.i_threads = X264_MIN( h->param.i_threads, max_threads ); h->param.i_threads = X264_MIN( h->param.i_threads, max_threads );
} }
} }
else h->param.i_threads = x264_clip3( h->param.i_threads, 1, X264_THREAD_MAX );
if( h->param.i_threads == 1 )
h->param.b_sliced_threads = 0; h->param.b_sliced_threads = 0;
h->i_thread_frames = h->param.b_sliced_threads ? 1 : h->param.i_threads; h->i_thread_frames = h->param.b_sliced_threads ? 1 : h->param.i_threads;
if( h->i_thread_frames > 1 ) if( h->i_thread_frames > 1 )
......
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