[FFmpeg-cvslog] avfilter/vf_colormatrix: make sure the number of threads is even for yuv420p

Clément Bœsch git at videolan.org
Tue Mar 17 20:19:59 CET 2015


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Tue Mar 17 20:09:49 2015 +0100| [09f057170e52442a9136b8298bb37897cc81f9e9] | committer: 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 -

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=09f057170e52442a9136b8298bb37897cc81f9e9
---

 libavfilter/vf_colormatrix.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_colormatrix.c b/libavfilter/vf_colormatrix.c
index cec0e3a..78d1bad 100644
--- a/libavfilter/vf_colormatrix.c
+++ b/libavfilter/vf_colormatrix.c
@@ -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));



More information about the ffmpeg-cvslog mailing list