diff options
author | Vincent Hamm | 2012-08-17 21:38:20 -0700 |
---|---|---|
committer | D G Turner | 2012-08-20 01:48:20 +0100 |
commit | bd6751cb4a2cb5f34697392a82e8d5ab35a6a006 (patch) | |
tree | 2f895e1957d154bd2b3860b4f99739cb4172d1dc /engines/cine/script_fw.cpp | |
parent | eccb55570e3ed27276573b23093ffedcf3e794cc (diff) | |
download | scummvm-rg350-bd6751cb4a2cb5f34697392a82e8d5ab35a6a006.tar.gz scummvm-rg350-bd6751cb4a2cb5f34697392a82e8d5ab35a6a006.tar.bz2 scummvm-rg350-bd6751cb4a2cb5f34697392a82e8d5ab35a6a006.zip |
CINE: Fix drawing of sprite with mask.
Protects against cases where a non-existing script is referenced.
Diffstat (limited to 'engines/cine/script_fw.cpp')
-rw-r--r-- | engines/cine/script_fw.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp index a34bf7ba2c..9cbe3c3fab 100644 --- a/engines/cine/script_fw.cpp +++ b/engines/cine/script_fw.cpp @@ -533,7 +533,6 @@ void RawScript::setData(const FWScriptInfo &info, const byte *data) { * @return Precalculated script labels */ const ScriptVars &RawScript::labels() const { - assert(_data); return _labels; } @@ -687,7 +686,7 @@ const char *FWScript::getNextString() { * @param pos Restored script position */ void FWScript::load(const ScriptVars &labels, const ScriptVars &local, uint16 compare, uint16 pos) { - assert(pos < _script._size); + assert(pos <= _script._size); _labels = labels; _localVars = local; _compare = compare; @@ -705,13 +704,15 @@ void FWScript::load(const ScriptVars &labels, const ScriptVars &local, uint16 co int FWScript::execute() { int ret = 0; - while (!ret) { - _line = _pos; - byte opcode = getNextByte(); - OpFunc handler = _info->opcodeHandler(opcode); + if(_script._size) { + while (!ret) { + _line = _pos; + byte opcode = getNextByte(); + OpFunc handler = _info->opcodeHandler(opcode); - if (handler) { - ret = (this->*handler)(); + if (handler) { + ret = (this->*handler)(); + } } } |