aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMichael Ball2019-10-12 14:47:20 -0500
committerBastien Bouclet2019-10-12 21:47:20 +0200
commit44b607a0523847ed8913bb030fbfc77651cd7a92 (patch)
tree47580554a04befb9ce17555f5616ad58f41f81e6 /engines
parent363d62cd3fdf75a4b759eaeba8127d1fd3cef5d8 (diff)
downloadscummvm-rg350-44b607a0523847ed8913bb030fbfc77651cd7a92.tar.gz
scummvm-rg350-44b607a0523847ed8913bb030fbfc77651cd7a92.tar.bz2
scummvm-rg350-44b607a0523847ed8913bb030fbfc77651cd7a92.zip
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.
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/cursors.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp
index 2cb41be65e..12c3ebfffe 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() {