From 0fb014b7bb6e60cca8828467ec937cc51dbaa166 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 20 May 2021 16:52:07 +0200 Subject: [PATCH] sws: reset sliceDir at the end of sws_scale() Makes it more clear that resetting it does not interact with the scaling code that it is currently intermixed with. --- libswscale/swscale.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 75226a29e4..dbbb930f9a 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -983,10 +983,6 @@ int attribute_align_arg sws_scale(struct SwsContext *c, reset_ptr(src2, c->srcFormat); reset_ptr((void*)dst2, c->dstFormat); - /* reset slice direction at end of frame */ - if (srcSliceY_internal + srcSliceH == c->srcH) - c->sliceDir = 0; - if (c->convert_unscaled) ret = c->convert_unscaled(c, src2, srcStride2, srcSliceY_internal, srcSliceH, dst2, dstStride2); @@ -1004,5 +1000,9 @@ int attribute_align_arg sws_scale(struct SwsContext *c, rgb48Toxyz12(c, dst16, dst16, dstStride2[0]/2, ret); } + /* reset slice direction at end of frame */ + if (srcSliceY_internal + srcSliceH == c->srcH) + c->sliceDir = 0; + return ret; }