diff options
author | Torbjörn Andersson | 2006-04-01 21:55:41 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2006-04-01 21:55:41 +0000 |
commit | d6f348638db398b29a574d52902a110cb067549e (patch) | |
tree | 43000d2c5fdeba6a61d68e2929b2cdeb609556bd /engines | |
parent | 2197597f9aa345d1c52806c502bf4f9f6c09a598 (diff) | |
download | scummvm-rg350-d6f348638db398b29a574d52902a110cb067549e.tar.gz scummvm-rg350-d6f348638db398b29a574d52902a110cb067549e.tar.bz2 scummvm-rg350-d6f348638db398b29a574d52902a110cb067549e.zip |
Guard against too many entries in resource.inf, since there has been a TODO
comment about that (removed in the previous commit) since roughly forever.
svn-id: r21536
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sword2/resman.cpp | 3 |
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(); |