diff options
author | Martin Kiewitz | 2010-05-23 16:59:09 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-05-23 16:59:09 +0000 |
commit | db74441d558103c626d1ec078583b0266a190e5d (patch) | |
tree | 25ba85095520db3e3fea913cf277d96f42436e61 /engines/sci/parser/grammar.cpp | |
parent | 9be4f6250cc88a1638299b3661b9896f4ebf57ed (diff) | |
download | scummvm-rg350-db74441d558103c626d1ec078583b0266a190e5d.tar.gz scummvm-rg350-db74441d558103c626d1ec078583b0266a190e5d.tar.bz2 scummvm-rg350-db74441d558103c626d1ec078583b0266a190e5d.zip |
SCI: fixing crash in _vocab_add_rule when running qfg2 demo
svn-id: r49160
Diffstat (limited to 'engines/sci/parser/grammar.cpp')
-rw-r--r-- | engines/sci/parser/grammar.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/sci/parser/grammar.cpp b/engines/sci/parser/grammar.cpp index 1cfe84076f..070e6767cf 100644 --- a/engines/sci/parser/grammar.cpp +++ b/engines/sci/parser/grammar.cpp @@ -258,6 +258,11 @@ void Vocabulary::freeRuleList(ParseRuleList *list) { static ParseRuleList *_vocab_add_rule(ParseRuleList *list, ParseRule *rule) { if (!rule) return list; + if (!rule->_data.size()) { + // Special case for qfg2 demo + warning("no rule contents on _vocab_add_rule()"); + return list; + } ParseRuleList *new_elem = new ParseRuleList(rule); |