summaryrefslogtreecommitdiff
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-10-06 14:41:41 +0200
commit359e10636296ab93b867313ae5ec24d1649fce73 (patch)
treef54dba8a50b37955b81ec696b09141fc20198779 /libavfilter
parentad92dec581f70289406ce5eb2afa5299994a56ed (diff)
downloadffmpeg-359e10636296ab93b867313ae5ec24d1649fce73.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);