From c9aab1ee7f3314ad9d79bc5f6f7a00ebe3f4e97f Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 19 Apr 2014 01:12:54 +0200 Subject: avfilter/vf_rotate: fix several of by 1 errors Signed-off-by: Michael Niedermayer --- libavfilter/vf_rotate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libavfilter/vf_rotate.c') diff --git a/libavfilter/vf_rotate.c b/libavfilter/vf_rotate.c index 94aa7c6a42..16c4a11873 100644 --- a/libavfilter/vf_rotate.c +++ b/libavfilter/vf_rotate.c @@ -328,8 +328,8 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs) int i, j, x, y; for (j = start; j < end; j++) { - x = xprime + xi + FIXP*inw/2; - y = yprime + yi + FIXP*inh/2; + x = xprime + xi + FIXP*(inw-1)/2; + y = yprime + yi + FIXP*(inh-1)/2; for (i = 0; i < outw; i++) { int32_t v; @@ -421,9 +421,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) .inw = FF_CEIL_RSHIFT(inlink->w, hsub), .inh = FF_CEIL_RSHIFT(inlink->h, vsub), .outh = outh, .outw = outw, - .xi = -outw/2 * c, .yi = outw/2 * s, - .xprime = -outh/2 * s, - .yprime = -outh/2 * c, + .xi = -(outw-1) * c / 2, .yi = (outw-1) * s / 2, + .xprime = -(outh-1) * s / 2, + .yprime = -(outh-1) * c / 2, .plane = plane, .c = c, .s = s }; -- cgit v1.2.3