aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur/files_threads.cpp
diff options
context:
space:
mode:
authorStrangerke2014-03-15 10:21:40 +0100
committerStrangerke2014-03-15 10:23:42 +0100
commitf73901ca9adcab29d5e8d1d4c7dca36d16806b93 (patch)
tree3df9898bb8c373a5b10536528b956d31e22c81da /engines/voyeur/files_threads.cpp
parent2e440e54e45aaa6dc37ac55a499c93989a95c31d (diff)
downloadscummvm-rg350-f73901ca9adcab29d5e8d1d4c7dca36d16806b93.tar.gz
scummvm-rg350-f73901ca9adcab29d5e8d1d4c7dca36d16806b93.tar.bz2
scummvm-rg350-f73901ca9adcab29d5e8d1d4c7dca36d16806b93.zip
VOYEUR: Add a check to avoid potential use of negative value as an array index
Diffstat (limited to 'engines/voyeur/files_threads.cpp')
-rw-r--r--engines/voyeur/files_threads.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp
index 98fe0d0bbf..700944f7ef 100644
--- a/engines/voyeur/files_threads.cpp
+++ b/engines/voyeur/files_threads.cpp
@@ -86,6 +86,9 @@ bool ThreadResource::loadAStack(int stackId) {
}
void ThreadResource::unloadAStack(int stackId) {
+ if (stackId < 0)
+ return;
+
if ((_vm->_stampFlags & 1) && _useCount[stackId]) {
if (--_useCount[stackId] == 0) {
_vm->_stampLibPtr->freeBoltMember(_vm->_controlPtr->_memberIds[stackId]);