diff options
author | Ladislav Zezula <ladislav.zezula@avg.com> | 2014-11-25 09:24:01 +0100 |
---|---|---|
committer | Ladislav Zezula <ladislav.zezula@avg.com> | 2014-11-25 09:24:01 +0100 |
commit | 495b2ab3d42db3f0d484e76eba15c7da9148d53a (patch) | |
tree | 0b479f6faf26ae3846328a25beabfff5dae6718f /src/SBaseFileTable.cpp | |
parent | eec75473b71cba0363dcb4c6985e92b266144ce5 (diff) |
+ Fixed bug in processing HET table
Diffstat (limited to 'src/SBaseFileTable.cpp')
-rw-r--r-- | src/SBaseFileTable.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/SBaseFileTable.cpp b/src/SBaseFileTable.cpp index 906edce..2d6249f 100644 --- a/src/SBaseFileTable.cpp +++ b/src/SBaseFileTable.cpp @@ -1115,7 +1115,7 @@ static int InsertHetEntry(TMPQHetTable * pHetTable, ULONGLONG FileNameHash, DWOR BYTE NameHash1; // Get the start index and the high 8 bits of the name hash - StartIndex = Index = (DWORD)(FileNameHash % pHetTable->dwEntryCount); + StartIndex = Index = (DWORD)(FileNameHash % pHetTable->dwTotalCount); NameHash1 = (BYTE)(FileNameHash >> (pHetTable->dwNameHashBitSize - 8)); // Find a place where to put it @@ -1137,7 +1137,7 @@ static int InsertHetEntry(TMPQHetTable * pHetTable, ULONGLONG FileNameHash, DWOR // Move to the next entry in the HET table // If we came to the start index again, we are done - Index = (Index + 1) % pHetTable->dwEntryCount; + Index = (Index + 1) % pHetTable->dwTotalCount; if(Index == StartIndex) break; } @@ -1257,7 +1257,7 @@ DWORD GetFileIndex_Het(TMPQArchive * ha, const char * szFileName) NameHash1 = (BYTE)(FileNameHash >> (pHetTable->dwNameHashBitSize - 8)); // Calculate the starting index to the hash table - StartIndex = Index = (DWORD)(FileNameHash % pHetTable->dwEntryCount); + StartIndex = Index = (DWORD)(FileNameHash % pHetTable->dwTotalCount); // Go through HET table until we find a terminator while(pHetTable->pNameHashes[Index] != HET_ENTRY_FREE) @@ -1286,7 +1286,7 @@ DWORD GetFileIndex_Het(TMPQArchive * ha, const char * szFileName) // Move to the next entry in the HET table // If we came to the start index again, we are done - Index = (Index + 1) % pHetTable->dwEntryCount; + Index = (Index + 1) % pHetTable->dwTotalCount; if(Index == StartIndex) break; } @@ -2438,7 +2438,7 @@ int BuildFileTable_HetBet( return ERROR_FILE_CORRUPT; // Step one: Fill the name indexes - for(i = 0; i < pHetTable->dwEntryCount; i++) + for(i = 0; i < pHetTable->dwTotalCount; i++) { DWORD dwFileIndex = 0; |