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

CC: libav-stable@libav.org
pull/235/head^2
Anton Khirnov 9 years ago
parent 3b08d9d932
commit a638e9184d
  1. 2
      libavfilter/vf_fade.c

@ -123,7 +123,7 @@ static int filter_slice_chroma(AVFilterContext *ctx, void *arg, int jobnr,
AVFrame *frame = arg; AVFrame *frame = arg;
int slice_h = FFALIGN(frame->height / nb_jobs, 1 << s->vsub); int slice_h = FFALIGN(frame->height / nb_jobs, 1 << s->vsub);
int slice_start = jobnr * slice_h; 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; int i, j, plane;
for (plane = 1; plane < 3; plane++) { for (plane = 1; plane < 3; plane++) {

Loading…
Cancel
Save