mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-26 19:55:44 +00:00
VOYEUR: Add a check to avoid potential use of negative value as an array index
This commit is contained in:
parent
2e440e54e4
commit
f73901ca9a
@ -86,6 +86,9 @@ bool ThreadResource::loadAStack(int stackId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ThreadResource::unloadAStack(int stackId) {
|
void ThreadResource::unloadAStack(int stackId) {
|
||||||
|
if (stackId < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if ((_vm->_stampFlags & 1) && _useCount[stackId]) {
|
if ((_vm->_stampFlags & 1) && _useCount[stackId]) {
|
||||||
if (--_useCount[stackId] == 0) {
|
if (--_useCount[stackId] == 0) {
|
||||||
_vm->_stampLibPtr->freeBoltMember(_vm->_controlPtr->_memberIds[stackId]);
|
_vm->_stampLibPtr->freeBoltMember(_vm->_controlPtr->_memberIds[stackId]);
|
||||||
|
Loading…
Reference in New Issue
Block a user