aboutsummaryrefslogtreecommitdiff
path: root/src/SBaseCommon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/SBaseCommon.cpp')
-rw-r--r--src/SBaseCommon.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/SBaseCommon.cpp b/src/SBaseCommon.cpp
index a0e789b..bb580b5 100644
--- a/src/SBaseCommon.cpp
+++ b/src/SBaseCommon.cpp
@@ -371,6 +371,7 @@ DWORD DetectFileKeyByKnownContent(void * pvFileContent, DWORD nDwords, ...)
// We need at least two DWORDS to detect the file key
if(nDwords < 0x02 || nDwords > 0x10)
return 0;
+ memset(dwDecrypted, 0, sizeof(dwDecrypted));
va_start(argList, nDwords);
for(i = 0; i < nDwords; i++)
@@ -639,7 +640,7 @@ ULONGLONG FindFreeMpqSpace(TMPQArchive * ha)
{
TMPQHeader * pHeader = ha->pHeader;
TFileEntry * pFileTableEnd = ha->pFileTable + ha->dwFileTableSize;
- TFileEntry * pFileEntry = ha->pFileTable;
+ TFileEntry * pFileEntry;
ULONGLONG FreeSpacePos = ha->pHeader->dwHeaderSize;
DWORD dwChunkCount;
@@ -952,7 +953,7 @@ int AllocateSectorOffsets(TMPQFile * hf, bool bLoadFromFile)
__LoadSectorOffsets:
// Allocate the sector offset table
- hf->SectorOffsets = (DWORD *)STORM_ALLOC(BYTE, dwSectorOffsLen);
+ hf->SectorOffsets = STORM_ALLOC(DWORD, (dwSectorOffsLen / sizeof(DWORD)));
if(hf->SectorOffsets == NULL)
return ERROR_NOT_ENOUGH_MEMORY;