aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2010-06-22 18:25:15 +0000
committerFilippos Karapetis2010-06-22 18:25:15 +0000
commit3a394793b6ef84d3bf200c7aac276ac39f8dc36f (patch)
treea30bb73295046112f1c4b3d8016eaf01f0ef6631 /engines
parent079e5c3135aea031a23401c39110cc883c421112 (diff)
downloadscummvm-rg350-3a394793b6ef84d3bf200c7aac276ac39f8dc36f.tar.gz
scummvm-rg350-3a394793b6ef84d3bf200c7aac276ac39f8dc36f.tar.bz2
scummvm-rg350-3a394793b6ef84d3bf200c7aac276ac39f8dc36f.zip
Fixed 2 crashes in QFG1VGA, when dying:
- Ignoring a non-game breaking script bug (modifying the "longSong" object with argc = 2) - Don't pop the callk stack frame if the stack is empty - fixes a crash when restoring from the death screen svn-id: r50157
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/vm.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index cc7f1a1be6..350734f8fc 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -417,6 +417,9 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, StackPt
if (!strcmp(objectName, "Sq4GlobalNarrator") && selector == 606) {
// SQ4 has a script bug in the Sq4GlobalNarrator object when invoking the
// returnVal selector, which doesn't affect gameplay, thus don't diplay it
+ } else if (!strcmp(objectName, "longSong") && selector == 3 && g_sci->getGameId() == "qfg1") {
+ // QFG1VGA has a script bug in the longSong object when invoking the
+ // loop selector, which doesn't affect gameplay, thus don't diplay it
} else {
// Unknown script bug, show it
reg_t oldReg = *varp.getPointer(s->_segMan);
@@ -636,8 +639,9 @@ static void callKernelFunc(EngineState *s, int kernelFuncNum, int argc) {
#endif
}
- // Remove callk stack frame again
- s->_executionStack.pop_back();
+ // Remove callk stack frame again, if there's still an execution stack
+ if (s->_executionStack.begin() != s->_executionStack.end())
+ s->_executionStack.pop_back();
} else {
Common::String warningMsg = "Dummy function " + kernelFunc.origName +
Common::String::printf("[0x%x]", kernelFuncNum) +