From d0be9c0a583860058a5f7212d62a8c9a086329d5 Mon Sep 17 00:00:00 2001 From: athrxx Date: Wed, 28 Dec 2011 21:53:40 +0100 Subject: KYRA: (EOB) - fix some valgrind warnings (overlapping source/dest) --- engines/kyra/screen.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index b6383c82cc..19314a5699 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -828,6 +828,9 @@ void Screen::copyRegion(int x1, int y1, int x2, int y2, int w, int h, int srcPag const uint8 *src = getPagePtr(srcPage) + y1 * SCREEN_W + x1; uint8 *dst = getPagePtr(dstPage) + y2 * SCREEN_W + x2; + if (src == dst) + return; + if (dstPage == 0 || dstPage == 1) addDirtyRect(x2, y2, w, h); @@ -835,7 +838,7 @@ void Screen::copyRegion(int x1, int y1, int x2, int y2, int w, int h, int srcPag if (flags & CR_NO_P_CHECK) { while (h--) { - memcpy(dst, src, w); + memmove(dst, src, w); src += SCREEN_W; dst += SCREEN_W; } -- cgit v1.2.3