[Scummvm-git-logs] scummvm master -> 44b607a0523847ed8913bb030fbfc77651cd7a92

bgK bastien.bouclet at gmail.com
Sat Oct 12 21:47:23 CEST 2019


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:
44b607a052 MOHAWK: RIVEN: Modify cursor preloading to resolve crashing on 3DS


Commit: 44b607a0523847ed8913bb030fbfc77651cd7a92
    https://github.com/scummvm/scummvm/commit/44b607a0523847ed8913bb030fbfc77651cd7a92
Author: Michael Ball (ballm4788 at gmail.com)
Date: 2019-10-12T21:47:20+02:00

Commit Message:
MOHAWK: RIVEN: Modify cursor preloading to resolve crashing on 3DS

Common::PEResources being allocated on the stack was causing a stack overflow. ScummVM is configured to have 256kb of stack memory on the 3DS.

Changed paths:
    engines/mohawk/cursors.cpp


diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp
index 2cb41be..12c3ebf 100644
--- a/engines/mohawk/cursors.cpp
+++ b/engines/mohawk/cursors.cpp
@@ -242,19 +242,21 @@ void LivingBooksCursorManager_v2::setCursor(const Common::String &name) {
 }
 
 PECursorManager::PECursorManager(const Common::String &appName) {
-	Common::PEResources exe;
-	if (!exe.loadFromEXE(appName)) {
+	Common::PEResources *exe = new Common::PEResources();
+	if (!exe->loadFromEXE(appName)) {
 		// Not all have cursors anyway, so this is not a problem
 		return;
 	}
 
-	const Common::Array<Common::WinResourceID> cursorGroups = exe.getNameList(Common::kWinGroupCursor);
+	const Common::Array<Common::WinResourceID> cursorGroups = exe->getNameList(Common::kWinGroupCursor);
 
 	_cursors.resize(cursorGroups.size());
 	for (uint i = 0; i < cursorGroups.size(); i++) {
 		_cursors[i].id = cursorGroups[i].getID();
-		_cursors[i].cursorGroup = Graphics::WinCursorGroup::createCursorGroup(exe, cursorGroups[i]);
+		_cursors[i].cursorGroup = Graphics::WinCursorGroup::createCursorGroup(*exe, cursorGroups[i]);
 	}
+
+	delete exe;
 }
 
 PECursorManager::~PECursorManager() {





More information about the Scummvm-git-logs mailing list