[Scummvm-cvs-logs] scummvm master -> 0887199400cccc7d666ed22a9864665b43376c72

sev- sev at scummvm.org
Tue Jun 7 23:05:24 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0887199400 SCUMM HE: Fix crashes in Moonbase replay


Commit: 0887199400cccc7d666ed22a9864665b43376c72
    https://github.com/scummvm/scummvm/commit/0887199400cccc7d666ed22a9864665b43376c72
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-06-07T22:23:42+02:00

Commit Message:
SCUMM HE: Fix crashes in Moonbase replay

Changed paths:
    engines/scumm/he/moonbase/moonbase_fow.cpp



diff --git a/engines/scumm/he/moonbase/moonbase_fow.cpp b/engines/scumm/he/moonbase/moonbase_fow.cpp
index b68d605..77f40a7 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;






More information about the Scummvm-git-logs mailing list