[FFmpeg-cvslog] avfilter/vf_dctdnoiz: Check threads
Michael Niedermayer
git at videolan.org
Tue Jun 8 19:00:48 EEST 2021
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Jun 5 20:00:38 2021 +0200| [4a3917c02c428b11128ac3d4a01b780ea44aa53c] | committer: Michael Niedermayer
avfilter/vf_dctdnoiz: Check threads
Fixes: floating point division by 0
Fixes: Ticket 8269
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4a3917c02c428b11128ac3d4a01b780ea44aa53c
---
libavfilter/vf_dctdnoiz.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavfilter/vf_dctdnoiz.c b/libavfilter/vf_dctdnoiz.c
index 63b1b29ea2..c7f949f9f5 100644
--- a/libavfilter/vf_dctdnoiz.c
+++ b/libavfilter/vf_dctdnoiz.c
@@ -564,6 +564,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);
More information about the ffmpeg-cvslog
mailing list