summaryrefslogtreecommitdiff
path: root/src/SBaseCommon.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <zezula-at-volny-dot-cz>2016-06-18 20:32:15 +0200
committerLadislav Zezula <zezula-at-volny-dot-cz>2016-06-18 20:32:15 +0200
commit303631f9d7f753dacffb1e038dd273dc204e1ea9 (patch)
tree5397acd7c5b8efe6e1a721f0177b534e38d9acd6 /src/SBaseCommon.cpp
parent47b6b6eb4addd82a89d6bcd8fa92f9c0a09a5781 (diff)
+ Updated for protectors fiddling with too big block table index
Diffstat (limited to 'src/SBaseCommon.cpp')
-rw-r--r--src/SBaseCommon.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SBaseCommon.cpp b/src/SBaseCommon.cpp
index 54fc6d0..95bdeb4 100644
--- a/src/SBaseCommon.cpp
+++ b/src/SBaseCommon.cpp
@@ -628,7 +628,7 @@ TMPQHash * GetFirstHashEntry(TMPQArchive * ha, const char * szFileName)
TMPQHash * pHash = ha->pHashTable + dwIndex;
// If the entry matches, we found it.
- if(pHash->dwName1 == dwName1 && pHash->dwName2 == dwName2 && pHash->dwBlockIndex < ha->dwFileTableSize)
+ if(pHash->dwName1 == dwName1 && pHash->dwName2 == dwName2 && MPQ_BLOCK_INDEX(pHash) < ha->dwFileTableSize)
return pHash;
// If that hash entry is a free entry, it means we haven't found the file
@@ -663,7 +663,7 @@ TMPQHash * GetNextHashEntry(TMPQArchive * ha, TMPQHash * pFirstHash, TMPQHash *
pHash = ha->pHashTable + dwIndex;
// If the entry matches, we found it.
- if(pHash->dwName1 == dwName1 && pHash->dwName2 == dwName2 && pHash->dwBlockIndex < ha->dwFileTableSize)
+ if(pHash->dwName1 == dwName1 && pHash->dwName2 == dwName2 && MPQ_BLOCK_INDEX(pHash) < ha->dwFileTableSize)
return pHash;
// If that hash entry is a free entry, it means we haven't found the file