[FFmpeg-devel] [PATCH 2/5] avfilter/vf_dctdnoiz: Check threads
Michael Niedermayer
michael at niedermayer.cc
Sun Jun 6 16:47:54 EEST 2021
Fixes: floating point division by 0
Fixes: Ticket 8269
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavfilter/vf_dctdnoiz.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavfilter/vf_dctdnoiz.c b/libavfilter/vf_dctdnoiz.c
index 63b1b29ea2..f09ab19c4d 100644
--- a/libavfilter/vf_dctdnoiz.c
+++ b/libavfilter/vf_dctdnoiz.c
@@ -568,6 +568,9 @@ static int config_input(AVFilterLink *inlink)
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);
+ if (!s->nb_threads)
+ return AVERROR(EINVAL);
+
s->p_linesize = linesize = FFALIGN(s->pr_width, 32);
for (i = 0; i < 2; i++) {
s->cbuf[i][0] = av_malloc_array(linesize * s->pr_height, sizeof(*s->cbuf[i][0]));
--
2.17.1
More information about the ffmpeg-devel
mailing list