avfilter: use ff_slice_pos() for per-slice boundary computation
This is a behavior preserving change for all non-overflowing cases.
Slice-based filters computed per-slice boundaries as (dim * jobnr) / nb_jobs
in int, which overflows for large dimensions with many slice threads,
yielding wrong slice bounds and out-of-array accesses. ff_slice_pos()
performs the multiplication in 64bit.
Backported to 4.4: applied the ff_slice_pos() conversion to the
dimension-based slices of the filters present in 4.4 (filters added after
the 4.4 branch are skipped), and added the required filters.h includes.
ff_slice_pos() itself is already present in 4.4. Channel-count based
slices (bounded, cannot overflow) are left unchanged.
(cherry picked from commit
f7368f97b92a0afe8dc8368a4b6749704b740317)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>