aboutsummaryrefslogtreecommitdiff
path: root/src/SFileReadFile.cpp
diff options
context:
space:
mode:
authorLadislav Zezula <zezula@volny.cz>2024-04-16 14:52:23 +0200
committerGitHub <noreply@github.com>2024-04-16 14:52:23 +0200
commit605222393594f5885b877bfc0086dae756674965 (patch)
treeaeabad8c5789d3a8a4605ed8ebab7539aac702e4 /src/SFileReadFile.cpp
parenta8f782a2d2602b20da0b9052c37a4ce85040ed27 (diff)
parent7fdae1508a001568d896300e951e83c0825a520d (diff)
Merge pull request #326 from ladislav-zezula/LZ_NewProtectedMPQ
Support for new MPQ protection
Diffstat (limited to 'src/SFileReadFile.cpp')
-rw-r--r--src/SFileReadFile.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/SFileReadFile.cpp b/src/SFileReadFile.cpp
index b0698c1..8ab5f48 100644
--- a/src/SFileReadFile.cpp
+++ b/src/SFileReadFile.cpp
@@ -194,6 +194,13 @@ static DWORD ReadMpqSectors(TMPQFile * hf, LPBYTE pbBuffer, DWORD dwByteOffset,
dwErrCode = ERROR_FILE_CORRUPT;
break;
}
+
+ // Special case (MPQ_2024_v1_300TK2.09p.w3x, file File00010254.blp):
+ // Extracted less than required. Fill the rest with zeros
+ if((DWORD)(cbOutSector) < dwBytesInThisSector)
+ {
+ memset(pbOutSector + cbOutSector, 0, dwBytesInThisSector - cbOutSector);
+ }
}
else
{