aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base
diff options
context:
space:
mode:
authorFilippos Karapetis2014-02-18 10:50:06 +0200
committerFilippos Karapetis2014-02-19 00:42:10 +0200
commit5d0ebad9968898377f65bd233332afadaf106b19 (patch)
treead5a5583fcbc29ee6ab31796ecefd7254b7b80c2 /engines/wintermute/base
parentb06497f351a090e6802c6a359667d05e2b5600f3 (diff)
downloadscummvm-rg350-5d0ebad9968898377f65bd233332afadaf106b19.tar.gz
scummvm-rg350-5d0ebad9968898377f65bd233332afadaf106b19.tar.bz2
scummvm-rg350-5d0ebad9968898377f65bd233332afadaf106b19.zip
WME: Fix bug #6531 - "WME: Art of Murder - Assertion"
Diffstat (limited to 'engines/wintermute/base')
-rw-r--r--engines/wintermute/base/scriptables/script_ext_string.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/wintermute/base/scriptables/script_ext_string.cpp b/engines/wintermute/base/scriptables/script_ext_string.cpp
index dae0a0d699..bc0c658c57 100644
--- a/engines/wintermute/base/scriptables/script_ext_string.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_string.cpp
@@ -298,7 +298,9 @@ bool SXString::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
uint32 start = 0;
for(uint32 i = 0; i < str.size() + 1; i++) {
- uint32 ch = str[i];
+ // The [] operator doesn't allow access to the zero code terminator
+ // (bug #6531)
+ uint32 ch = (i == str.size()) ? '\0' : str[i];
if (ch =='\0' || delims.contains(ch)) {
if (i != start) {
parts.push_back(WideString(str.c_str() + start, i - start + 1));