]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/vf_bm3d: make sure nb_jobs is at least 1
authorPaul B Mahol <onemda@gmail.com>
Tue, 15 Oct 2019 15:59:43 +0000 (17:59 +0200)
committerPaul B Mahol <onemda@gmail.com>
Tue, 15 Oct 2019 15:59:43 +0000 (17:59 +0200)
libavfilter/vf_bm3d.c

index 3196b63884cb4a2b611f0f5203516702273cad9d..a602283e38037819f9e8f4632b8631ec62c0e69d 100644 (file)
@@ -748,7 +748,7 @@ static int filter_frame(AVFilterContext *ctx, AVFrame **out, AVFrame *in, AVFram
     av_frame_copy_props(*out, in);
 
     for (p = 0; p < s->nb_planes; p++) {
-        const int nb_jobs = FFMIN(s->nb_threads, s->planeheight[p] / s->block_size);
+        const int nb_jobs = FFMAX(1, FFMIN(s->nb_threads, s->planeheight[p] / s->block_size));
         ThreadData td;
 
         if (!((1 << p) & s->planes) || ctx->is_disabled) {