aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sword2/resman.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/sword2/resman.cpp b/engines/sword2/resman.cpp
index 7778c2c7d7..506634097e 100644
--- a/engines/sword2/resman.cpp
+++ b/engines/sword2/resman.cpp
@@ -89,7 +89,8 @@ ResourceManager::ResourceManager(Sword2Engine *vm) {
while (file.readLine(_resFiles[_totalClusters].fileName, sizeof(_resFiles[_totalClusters].fileName))) {
_resFiles[_totalClusters].numEntries = -1;
_resFiles[_totalClusters].entryTab = NULL;
- _totalClusters++;
+ if (++_totalClusters >= MAX_res_files)
+ error("Too many entries in resource.inf");
}
file.close();