+ Fixed possible division by zero in LoadMpqDataBitmap

+ Updated zlib to version 1.2.5 (the same like current WoW build uses)
This commit is contained in:
Ladislav
2013-09-15 10:23:57 +02:00
parent dab826ac10
commit fd9326ba5c
25 changed files with 1558 additions and 958 deletions

View File

@@ -1769,7 +1769,7 @@ int LoadMpqDataBitmap(TMPQArchive * ha, ULONGLONG FileSize, bool * pbFileIsCompl
// Note: Do not rely on file size when looking for the bitmap.
// Battle.net.MPQ from SC2:HOTS (build 22342) has some data appended after the bitmap
EndOfMpq = ha->MpqPos + ha->pHeader->ArchiveSize64;
if(FileSize > EndOfMpq)
if(FileSize > EndOfMpq && ha->pHeader->dwRawChunkSize != 0)
{
// Calculate the number of extra bytes for data bitmap
DataBlockCount = (DWORD)(((ha->pHeader->ArchiveSize64 - 1) / ha->pHeader->dwRawChunkSize) + 1);