History

avfilter/dctdnoiz: fix slice_h computation

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 -

Clément Bœsch committed 11 years ago

Commit eb7efaa1 parent 009a57b1 file · +1 −1Browse files

Unified · Split

libavfilter/vf_dctdnoiz.c+1−1
@@ -534,7 +534,7 @@ static int config_input(AVFilterLink *inlink) · 533 unmodified lines
534534 /* each slice will need to (pre & re)process the top and bottom block of
535535 * the previous one in in addition to its processing area. This is because
536536 * each pixel is averaged by all the surrounding blocks */
537− slice_h = (int)ceilf(s->pr_height / s->nb_threads) + (s->bsize - 1) * 2;
537+ slice_h = (int)ceilf(s->pr_height / (float)s->nb_threads) + (s->bsize - 1) * 2;
538538 for (i = 0; i < s->nb_threads; i++) {
539539 s->slices[i] = av_malloc_array(linesize, slice_h * sizeof(*s->slices[i]));
540540 if (!s->slices[i])

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t