aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-11-06 14:36:45 -0500
committerPaul Gilbert2016-11-06 14:36:45 -0500
commite6c15b8f4d3d02c8b071ca389f5e0a0c4fbc17db (patch)
tree96513e5a834e966413f45ea1e095086e406970dd /engines/titanic
parent927adb7f05e06ecc3a6303dbc2437e8b8f45dd70 (diff)
downloadscummvm-rg350-e6c15b8f4d3d02c8b071ca389f5e0a0c4fbc17db.tar.gz
scummvm-rg350-e6c15b8f4d3d02c8b071ca389f5e0a0c4fbc17db.tar.bz2
scummvm-rg350-e6c15b8f4d3d02c8b071ca389f5e0a0c4fbc17db.zip
TITANIC: Fix crash in TTparser::processModifiers
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/true_talk/tt_parser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 23a5a91ad4..28160a07ea 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -1634,7 +1634,7 @@ int TTparser::processModifiers(int modifier, TTword *word) {
TTconcept *newConcept = new TTconcept(word, ST_UNKNOWN_SCRIPT);
// Cycles through each word
- for (TTword *currP = _currentWordP; currP != word; currP = _currentWordP) {
+ for (TTword *currP = _currentWordP; currP && currP != word; currP = _currentWordP) {
if ((modifier == 2 && currP->_wordClass == WC_ADJECTIVE) ||
(modifier == 1 && currP->_wordClass == WC_ADVERB)) {
newConcept->_string2 += ' ';