From 6a0a6357819dea49ad8e239ad77e82171ef6267b Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 30 Aug 2024 09:12:19 +1000 Subject: [PATCH] [common] rect: fix avx unaligned bytes copy Thanks @D0ot for debugging and finding this this, the LG community are very appreciate for a fix for this long outstanding bug. Fixes #1129 Closes #1136 --- common/src/rects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/rects.c b/common/src/rects.c index d5da1015..90dd8db5 100644 --- a/common/src/rects.c +++ b/common/src/rects.c @@ -335,7 +335,7 @@ static void rectCopyUnaligned_avx( for (int i = ystart; i < yend; ++i) { // copy the unaligned bytes - for(int col = align; col >= 0; --col) + for(int col = align - 1; col >= 0; --col) dst[col] = src[col]; const __m256i *restrict s = (__m256i*)(src + align);