aboutsummaryrefslogtreecommitdiff
path: root/src/SFileOpenArchive.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <E:\Ladik\Mail>2016-05-27 16:50:50 +0200
committerLadislav Zezula <E:\Ladik\Mail>2016-05-27 16:50:50 +0200
commit47b6b6eb4addd82a89d6bcd8fa92f9c0a09a5781 (patch)
tree5fb9c92f6352c9275d27d6ebb9aee87e20c75151 /src/SFileOpenArchive.cpp
parentf1655f8afe2ef76d4906eb3e94dfd3c2b5241eb4 (diff)
+ Support for MPQs that have invalid (and ignored) flags in the block table
+ Support for MPQs that have malformed block indexes (0x8000xxxx or 0x4000xxxx)
Diffstat (limited to 'src/SFileOpenArchive.cpp')
-rw-r--r--src/SFileOpenArchive.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SFileOpenArchive.cpp b/src/SFileOpenArchive.cpp
index 6a249f2..2cb6698 100644
--- a/src/SFileOpenArchive.cpp
+++ b/src/SFileOpenArchive.cpp
@@ -369,8 +369,8 @@ bool WINAPI SFileOpenArchive(
// higher than 0x10000000, it would overflow in 32-bit version
// Observed in the malformed Warcraft III maps
// Example map: MPQ_2016_v1_ProtectedMap_TableSizeOverflow.w3x
- ha->pHeader->dwHashTableSize &= 0x0FFFFFFF;
- ha->pHeader->dwBlockTableSize &= 0x0FFFFFFF;
+ ha->pHeader->dwBlockTableSize = MPQ_BLOCK_INDEX(ha->pHeader->dwBlockTableSize);
+ ha->pHeader->dwHashTableSize = MPQ_BLOCK_INDEX(ha->pHeader->dwHashTableSize);
// Both MPQ_OPEN_NO_LISTFILE or MPQ_OPEN_NO_ATTRIBUTES trigger read only mode
if(dwFlags & (MPQ_OPEN_NO_LISTFILE | MPQ_OPEN_NO_ATTRIBUTES))