From 9478d266f7df35d2addf2a0923aa1e483e5e722a Mon Sep 17 00:00:00 2001 From: Ankith Date: Wed, 11 Jun 2025 15:39:00 +0530 Subject: [PATCH] Fix ASAN issues in surface scroll tests --- src_c/surface.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src_c/surface.c b/src_c/surface.c index e8ffc6b29e..05a90afd27 100644 --- a/src_c/surface.c +++ b/src_c/surface.c @@ -2780,12 +2780,12 @@ scroll_repeat(int h, int dx, int dy, int pitch, int span, int xoffset, while (h--) { if (dx > 0) { memcpy(tempbuf, linesrc + span - xoffset, xoffset); - memcpy(linesrc + xoffset, linesrc, span - xoffset); + memmove(linesrc + xoffset, linesrc, span - xoffset); memcpy(linesrc, tempbuf, xoffset); } else if (dx < 0) { memcpy(tempbuf, linesrc, -xoffset); - memcpy(linesrc, linesrc - xoffset, span + xoffset); + memmove(linesrc, linesrc - xoffset, span + xoffset); memcpy(linesrc + span + xoffset, tempbuf, -xoffset); } linesrc += pitch; @@ -2835,13 +2835,13 @@ scroll_default(int h, int dx, int dy, int pitch, int span, int xoffset, // No y-shifting, we only need to move pixels on the same line while (h--) { if (dx > 0) { - memcpy(linesrc + xoffset, linesrc, span - xoffset); + memmove(linesrc + xoffset, linesrc, span - xoffset); if (erase) { memset(linesrc, 0, xoffset); } } else if (dx < 0) { - memcpy(linesrc, linesrc - xoffset, span + xoffset); + memmove(linesrc, linesrc - xoffset, span + xoffset); if (erase) { memset(linesrc + span + xoffset, 0, -xoffset); }