Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-06-05 21:00:38 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-06 14:54:16 +0300
commitf747fd6d6f4f7fcc3d3613c23cc25fe2a2316b48 (patch)
tree5e6b10c6500e5342d82543569bfa1c5e3b078e7b /libavfilter
parent879ac3418eb946a2e7c82777977c29f553549120 (diff)
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);