aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he
diff options
context:
space:
mode:
authorEugene Sandulenko2016-06-07 22:20:18 +0200
committerEugene Sandulenko2016-06-07 22:23:42 +0200
commit0887199400cccc7d666ed22a9864665b43376c72 (patch)
tree671a3056db660ec473c38482170dbb163d199307 /engines/scumm/he
parent060fafd6568c24d5cf1784b19541fc4c6ac19550 (diff)
downloadscummvm-rg350-0887199400cccc7d666ed22a9864665b43376c72.tar.gz
scummvm-rg350-0887199400cccc7d666ed22a9864665b43376c72.tar.bz2
scummvm-rg350-0887199400cccc7d666ed22a9864665b43376c72.zip
SCUMM HE: Fix crashes in Moonbase replay
Diffstat (limited to 'engines/scumm/he')
-rw-r--r--engines/scumm/he/moonbase/moonbase_fow.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/scumm/he/moonbase/moonbase_fow.cpp b/engines/scumm/he/moonbase/moonbase_fow.cpp
index b68d6051ff..77f40a7d97 100644
--- a/engines/scumm/he/moonbase/moonbase_fow.cpp
+++ b/engines/scumm/he/moonbase/moonbase_fow.cpp
@@ -114,8 +114,14 @@ bool Moonbase::setFOWImage(int image) {
delete stream;
}
- if (!_fowImage && image > 0)
- _fowImage = _vm->getResourceAddress(rtImage, image);
+ if (!_fowImage && image > 0) {
+ int sz = _vm->getResourceSize(rtImage, image);
+ _fowImage = (uint8 *)malloc(sz);
+
+ // We have to copy it, otherwise the resource manager
+ // will kill it earlier or later. Matches original.
+ memcpy(_fowImage, _vm->getResourceAddress(rtImage, image), sz);
+ }
if (!_fowImage)
return false;