aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2015-02-08 14:27:51 +0100
committerClément Bœsch <u@pkh.me>2015-02-12 20:21:56 +0100
commit3429714f3d046f4e2235848a60b6f63bd084e01f (patch)
treea3e2423414807f37c94dbf40e9530b57dbda0ce2
parentee902d3d2d78b1aed7d1c562d58128b450a54b02 (diff)
downloadffmpeg-3429714f3d046f4e2235848a60b6f63bd084e01f.tar.gz
avfilter/dctdnoiz: fix slice_h computationn2.5.4
ceilf() can only work if the reminder of the division is not 0. This fixes memory errors with for instance: ffmpeg -f lavfi -i testsrc=s=800x500 -threads 3 -vf dctdnoiz -frames:v 1 -f null - (cherry picked from commit eb7efaa9244720c5f2051d76d76faeec864eca7a)
-rw-r--r--libavfilter/vf_dctdnoiz.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_dctdnoiz.c b/libavfilter/vf_dctdnoiz.c
index a9017b1f1c..7246b01d0b 100644
--- a/libavfilter/vf_dctdnoiz.c
+++ b/libavfilter/vf_dctdnoiz.c
@@ -534,7 +534,7 @@ static int config_input(AVFilterLink *inlink)
/* each slice will need to (pre & re)process the top and bottom block of
* the previous one in in addition to its processing area. This is because
* each pixel is averaged by all the surrounding blocks */
- slice_h = (int)ceilf(s->pr_height / s->nb_threads) + (s->bsize - 1) * 2;
+ slice_h = (int)ceilf(s->pr_height / (float)s->nb_threads) + (s->bsize - 1) * 2;
for (i = 0; i < s->nb_threads; i++) {
s->slices[i] = av_malloc_array(linesize, slice_h * sizeof(*s->slices[i]));
if (!s->slices[i])