diff options
author | Strangerke | 2014-02-26 07:59:56 +0100 |
---|---|---|
committer | Strangerke | 2014-02-26 07:59:56 +0100 |
commit | 54095bd323a755b23cc5de462ba810d4b5f7484b (patch) | |
tree | b570bd1b6f2eff837587650dbafb1fefded09ab6 /engines/voyeur | |
parent | eb5b927ed1544e528c288e818ba7c99d07db2cb2 (diff) | |
download | scummvm-rg350-54095bd323a755b23cc5de462ba810d4b5f7484b.tar.gz scummvm-rg350-54095bd323a755b23cc5de462ba810d4b5f7484b.tar.bz2 scummvm-rg350-54095bd323a755b23cc5de462ba810d4b5f7484b.zip |
VOYEUR: Add a sanity check in loadAStack()
Diffstat (limited to 'engines/voyeur')
-rw-r--r-- | engines/voyeur/files_threads.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp index d0addc868f..7261aa2449 100644 --- a/engines/voyeur/files_threads.cpp +++ b/engines/voyeur/files_threads.cpp @@ -46,7 +46,7 @@ ThreadResource::ThreadResource(BoltFilesState &state, const byte *src):_vm(state _stateFlags = 0; _stateCount = 0; _parseCount = 0; - _nextStateId = -1; + _nextStateId = 0; _threadInfoPtr = nullptr; _playCommandsPtr = nullptr; } @@ -65,6 +65,9 @@ void ThreadResource::initThreadStruct(int idx, int id) { bool ThreadResource::loadAStack(int stackId) { if (_vm->_stampFlags & 1) { + if (stackId < 0) + error('loadAStack() - Invalid stackId %d', stackId); + unloadAStack(_stackId); if (!_useCount[stackId]) { BoltEntry &boltEntry = _vm->_stampLibPtr->boltEntry(_vm->_controlPtr->_memberIds[stackId]); |