aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorathrxx2011-12-28 21:53:40 +0100
committerathrxx2011-12-29 19:12:34 +0100
commitd0be9c0a583860058a5f7212d62a8c9a086329d5 (patch)
treeab9766b341482a2920f5f075dd9893c97db0e661 /engines
parent5b1095a4008613ec7f2efd6349670521a6d44dae (diff)
downloadscummvm-rg350-d0be9c0a583860058a5f7212d62a8c9a086329d5.tar.gz
scummvm-rg350-d0be9c0a583860058a5f7212d62a8c9a086329d5.tar.bz2
scummvm-rg350-d0be9c0a583860058a5f7212d62a8c9a086329d5.zip
KYRA: (EOB) - fix some valgrind warnings
(overlapping source/dest)
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/screen.cpp5
1 files changed, 4 insertions, 1 deletions
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;
}