From f73901ca9adcab29d5e8d1d4c7dca36d16806b93 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 15 Mar 2014 10:21:40 +0100 Subject: VOYEUR: Add a check to avoid potential use of negative value as an array index --- engines/voyeur/files_threads.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/voyeur/files_threads.cpp') 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]); -- cgit v1.2.3