Module: libav
Branch: release/11
Commit: 9d37f2f1eb5f53cd91a47681709767cea3d0ddd5

Author:    Anton Khirnov <an...@khirnov.net>
Committer: Anton Khirnov <an...@khirnov.net>
Date:      Thu Mar 24 21:38:54 2016 +0100

vf_fade: make sure the slice end is always in the frame

CC: libav-sta...@libav.org
(cherry picked from commit a638e9184d63e57e67901f34afe919fd56fd3ac4)
Signed-off-by: Anton Khirnov <an...@khirnov.net>

---

 libavfilter/vf_fade.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c
index eac0c2c..eb6d82a 100644
--- a/libavfilter/vf_fade.c
+++ b/libavfilter/vf_fade.c
@@ -123,7 +123,7 @@ static int filter_slice_chroma(AVFilterContext *ctx, void 
*arg, int jobnr,
     AVFrame *frame = arg;
     int slice_h     = FFALIGN(frame->height / nb_jobs, 1 << s->vsub);
     int slice_start = jobnr * slice_h;
-    int slice_end   = (jobnr == nb_jobs - 1) ? frame->height : (jobnr + 1) * 
slice_h;
+    int slice_end   = FFMIN((jobnr + 1) * slice_h, frame->height);
     int i, j, plane;
 
     for (plane = 1; plane < 3; plane++) {

_______________________________________________
libav-commits mailing list
libav-commits@libav.org
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to