aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-06-05 20:00:38 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 13:54:52 +0200
commit5498836d7da25342b0595e4908a529d169a22fb9 (patch)
treec91fa54f9928d65665001ddd170c3da0ee65cf28 /libavfilter
parent5625dc1f3234020cddf3e7217ecc455249f3f647 (diff)
downloadffmpeg-5498836d7da25342b0595e4908a529d169a22fb9.tar.gz
avfilter/vf_dctdnoiz: Check threads
Fixes: floating point division by 0 Fixes: Ticket 8269 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 4a3917c02c428b11128ac3d4a01b780ea44aa53c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_dctdnoiz.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavfilter/vf_dctdnoiz.c b/libavfilter/vf_dctdnoiz.c
index cdbe5f853f..3fbea473ed 100644
--- a/libavfilter/vf_dctdnoiz.c
+++ b/libavfilter/vf_dctdnoiz.c
@@ -563,6 +563,9 @@ static int config_input(AVFilterLink *inlink)
inlink->h - s->pr_height);
max_slice_h = s->pr_height / ((s->bsize - 1) * 2);
+ if (max_slice_h == 0)
+ return AVERROR(EINVAL);
+
s->nb_threads = FFMIN3(MAX_THREADS, ff_filter_get_nb_threads(ctx), max_slice_h);
av_log(ctx, AV_LOG_DEBUG, "threads: [max=%d hmax=%d user=%d] => %d\n",
MAX_THREADS, max_slice_h, ff_filter_get_nb_threads(ctx), s->nb_threads);