aboutsummaryrefslogtreecommitdiff
path: root/src/SBaseFileTable.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <ladislav.zezula@avg.com>2014-12-23 15:04:35 +0100
committerLadislav Zezula <ladislav.zezula@avg.com>2014-12-23 15:04:35 +0100
commite9842c38cf9c55f682b2a411cea84ee59d69ec92 (patch)
treee84f32cb42246743b1ce84e91910d855b0ee13a6 /src/SBaseFileTable.cpp
parent48b5cb606e5f1b407069a1babfb17ccbcb630e55 (diff)
+ Adding files into MPQs that have BlockTableSize > HashTableSize is not allowed
+ Compacting MPQs that have BlockTableSize > HashTableSize is allowed
Diffstat (limited to 'src/SBaseFileTable.cpp')
-rw-r--r--src/SBaseFileTable.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/SBaseFileTable.cpp b/src/SBaseFileTable.cpp
index 2d6249f..68ad0d7 100644
--- a/src/SBaseFileTable.cpp
+++ b/src/SBaseFileTable.cpp
@@ -2629,7 +2629,6 @@ int RebuildFileTable(TMPQArchive * ha, DWORD dwNewHashTableSize, DWORD dwNewMaxF
// The new hash table size must be greater or equal to the current hash table size
assert(dwNewHashTableSize >= ha->pHeader->dwHashTableSize);
- assert(dwNewMaxFileCount >= ha->dwFileTableSize);
// The new hash table size must be a power of two
assert((dwNewHashTableSize & (dwNewHashTableSize - 1)) == 0);
@@ -2676,7 +2675,11 @@ int RebuildFileTable(TMPQArchive * ha, DWORD dwNewHashTableSize, DWORD dwNewMaxF
if(ha->pHashTable != NULL)
{
pHash = AllocateHashEntry(ha, pFileEntry);
- assert(pHash != NULL);
+ if(pHash == NULL)
+ {
+ nError = ERROR_DISK_FULL;
+ break;
+ }
}
// Move the file entry by one