mirror of
https://github.com/ladislav-zezula/StormLib.git
synced 2026-01-23 15:56:18 +01:00
+ Updated for protectors fiddling with too big block table index
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user