Commit 09f05717 authored by Clément Bœsch's avatar Clément Bœsch

avfilter/vf_colormatrix: make sure the number of threads is even for yuv420p

Fix crash with for example:
  ffmpeg -f lavfi -i testsrc=568x320 -threads 3 -vf format=yuv420p,colormatrix=bt709:smpte170m -f null -
parent 2cfa1fdb
......@@ -416,7 +416,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
FFMIN(in->height, ctx->graph->nb_threads));
else if (in->format == AV_PIX_FMT_YUV420P)
ctx->internal->execute(ctx, process_slice_yuv420p, &td, NULL,
FFMIN(in->height, ctx->graph->nb_threads));
FFMAX(1, FFMIN(in->height, ctx->graph->nb_threads) & ~1));
else
ctx->internal->execute(ctx, process_slice_uyvy422, &td, NULL,
FFMIN(in->height, ctx->graph->nb_threads));
......
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