mirror of https://git.ffmpeg.org/ffmpeg.git
avfilter/vf_dctdnoiz: Check threads
Fixes: floating point division by 0 Fixes: Ticket 8269 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
3d500e62f6
commit
4a3917c02c
|
@ -564,6 +564,9 @@ static int config_input(AVFilterLink *inlink)
|
||||||
inlink->h - s->pr_height);
|
inlink->h - s->pr_height);
|
||||||
|
|
||||||
max_slice_h = s->pr_height / ((s->bsize - 1) * 2);
|
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);
|
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",
|
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);
|
MAX_THREADS, max_slice_h, ff_filter_get_nb_threads(ctx), s->nb_threads);
|
||||||
|
|
Loading…
Reference in New Issue