vf_fade: Make sure to not miss the last lines of a frame
authorMartin Storsjö <martin@martin.st>
Thu, 16 Feb 2017 10:23:20 +0000 (12:23 +0200)
committerSean McGovern <gseanmcg@gmail.com>
Sun, 19 Feb 2017 03:54:20 +0000 (22:54 -0500)
commit1e497344f335b4cfef72cd0447ae63c8ebe6c0fe
tree91d5dd56108f88abfc717fbf04842905365c1e96
parent80bd3e5cde1f31cd0e1c2ed702a67b0661b2ae21
vf_fade: Make sure to not miss the last lines of a frame

When slice_h is rounded up due to chroma subsampling, there's
a risk that jobnr * slice_h exceeds frame->height.

Prior to a638e9184d63, this wasn't an issue for the last slice
of a frame, since slice_end was set to frame->height for the last
slice.

a638e9184d63 tried to fix the case where other slices than the
last one would exceed frame->height (which can happen where the
number of slices/threads is very large compared to the frame
height).

However, the fix in a638e9184d63 instead broke other cases,
where slice_h * nb_threads < frame->height. Therefore, make
sure the last slice always ends at frame->height.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 8f5de34c8fb18fa1416e77d2cb998773a49ddb3d)
Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
libavfilter/vf_fade.c