aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorArnaud Boutonné2010-12-08 21:18:48 +0000
committerArnaud Boutonné2010-12-08 21:18:48 +0000
commit9a117e3eca7fd3f6fc7254d1664bd9cc0206e0b7 (patch)
treef7db3fbe062da08e35f56f4085a3eed734de344e /engines
parentefc5ab5398d7ff3fabb13c6488229d98d57c767d (diff)
downloadscummvm-rg350-9a117e3eca7fd3f6fc7254d1664bd9cc0206e0b7.tar.gz
scummvm-rg350-9a117e3eca7fd3f6fc7254d1664bd9cc0206e0b7.tar.bz2
scummvm-rg350-9a117e3eca7fd3f6fc7254d1664bd9cc0206e0b7.zip
HUGO: Hopefully fix overlapping memory regions
Thanks Digitall for debugging that svn-id: r54835
Diffstat (limited to 'engines')
-rw-r--r--engines/hugo/object_v1d.cpp6
-rw-r--r--engines/hugo/object_v1w.cpp6
-rw-r--r--engines/hugo/object_v3d.cpp6
3 files changed, 9 insertions, 9 deletions
diff --git a/engines/hugo/object_v1d.cpp b/engines/hugo/object_v1d.cpp
index 669c4fb131..7b42263759 100644
--- a/engines/hugo/object_v1d.cpp
+++ b/engines/hugo/object_v1d.cpp
@@ -361,9 +361,9 @@ void ObjectHandler_v1d::swapImages(int objNumb1, int objNumb2) {
seqList_t tmpSeqList[MAX_SEQUENCES];
int seqListSize = sizeof(seqList_t) * MAX_SEQUENCES;
- memcpy(tmpSeqList, _objects[objNumb1].seqList, seqListSize);
- memcpy(_objects[objNumb1].seqList, _objects[objNumb2].seqList, seqListSize);
- memcpy(_objects[objNumb2].seqList, tmpSeqList, seqListSize);
+ memmove(tmpSeqList, _objects[objNumb1].seqList, seqListSize);
+ memmove(_objects[objNumb1].seqList, _objects[objNumb2].seqList, seqListSize);
+ memmove(_objects[objNumb2].seqList, tmpSeqList, seqListSize);
_objects[objNumb1].currImagePtr = _objects[objNumb1].seqList[0].seqPtr;
_objects[objNumb2].currImagePtr = _objects[objNumb2].seqList[0].seqPtr;
_vm->_heroImage = (_vm->_heroImage == HERO) ? objNumb2 : HERO;
diff --git a/engines/hugo/object_v1w.cpp b/engines/hugo/object_v1w.cpp
index b47bd0e488..708376a01b 100644
--- a/engines/hugo/object_v1w.cpp
+++ b/engines/hugo/object_v1w.cpp
@@ -371,9 +371,9 @@ void ObjectHandler_v1w::swapImages(int objNumb1, int objNumb2) {
seqList_t tmpSeqList[MAX_SEQUENCES];
int seqListSize = sizeof(seqList_t) * MAX_SEQUENCES;
- memcpy(tmpSeqList, _objects[objNumb1].seqList, seqListSize);
- memcpy(_objects[objNumb1].seqList, _objects[objNumb2].seqList, seqListSize);
- memcpy(_objects[objNumb2].seqList, tmpSeqList, seqListSize);
+ memmove(tmpSeqList, _objects[objNumb1].seqList, seqListSize);
+ memmove(_objects[objNumb1].seqList, _objects[objNumb2].seqList, seqListSize);
+ memmove(_objects[objNumb2].seqList, tmpSeqList, seqListSize);
restoreSeq(&_objects[objNumb1]);
_objects[objNumb2].currImagePtr = _objects[objNumb2].seqList[0].seqPtr;
_vm->_heroImage = (_vm->_heroImage == HERO) ? objNumb2 : HERO;
diff --git a/engines/hugo/object_v3d.cpp b/engines/hugo/object_v3d.cpp
index ce99ef4c48..431c71498f 100644
--- a/engines/hugo/object_v3d.cpp
+++ b/engines/hugo/object_v3d.cpp
@@ -255,9 +255,9 @@ void ObjectHandler_v3d::swapImages(int objNumb1, int objNumb2) {
seqList_t tmpSeqList[MAX_SEQUENCES];
int seqListSize = sizeof(seqList_t) * MAX_SEQUENCES;
- memcpy(tmpSeqList, _objects[objNumb1].seqList, seqListSize);
- memcpy(_objects[objNumb1].seqList, _objects[objNumb2].seqList, seqListSize);
- memcpy(_objects[objNumb2].seqList, tmpSeqList, seqListSize);
+ memmove(tmpSeqList, _objects[objNumb1].seqList, seqListSize);
+ memmove(_objects[objNumb1].seqList, _objects[objNumb2].seqList, seqListSize);
+ memmove(_objects[objNumb2].seqList, tmpSeqList, seqListSize);
restoreSeq(&_objects[objNumb1]);
_objects[objNumb2].currImagePtr = _objects[objNumb2].seqList[0].seqPtr;
_vm->_heroImage = (_vm->_heroImage == HERO) ? objNumb2 : HERO;