diff options
author | Ladislav Zezula <zezula@volny.cz> | 2024-04-16 14:52:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-16 14:52:23 +0200 |
commit | 605222393594f5885b877bfc0086dae756674965 (patch) | |
tree | aeabad8c5789d3a8a4605ed8ebab7539aac702e4 /src/SFileReadFile.cpp | |
parent | a8f782a2d2602b20da0b9052c37a4ce85040ed27 (diff) | |
parent | 7fdae1508a001568d896300e951e83c0825a520d (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.cpp | 7 |
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 { |