aboutsummaryrefslogtreecommitdiff
path: root/src/SBaseFileTable.cpp
diff options
context:
space:
mode:
authorLadislav <Zezula>2013-12-15 10:29:50 +0100
committerLadislav <Zezula>2013-12-15 10:29:50 +0100
commitfe51da468be9ca0963192c5f3a1705562bc957ba (patch)
tree767edeed5f8cd2b4561317724efdb2d1b2547d7b /src/SBaseFileTable.cpp
parent6961cd51b65e8df7f807e25ab6ffc4da8c205449 (diff)
+ static analysis issues fixed
Diffstat (limited to 'src/SBaseFileTable.cpp')
-rw-r--r--src/SBaseFileTable.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/SBaseFileTable.cpp b/src/SBaseFileTable.cpp
index d4155bd..d88c5f9 100644
--- a/src/SBaseFileTable.cpp
+++ b/src/SBaseFileTable.cpp
@@ -499,7 +499,7 @@ int ConvertMpqHeaderToFormat4(
if(pHeader->HetTablePos64)
{
pHeader->HetTableSize64 = ByteOffset - pHeader->HetTablePos64;
- ByteOffset = pHeader->HetTablePos64;
+// ByteOffset = pHeader->HetTablePos64;
}
break;
@@ -1479,7 +1479,7 @@ static TMPQBetTable * TranslateBetTable(
LengthInBytes = (pBetTable->pNameHashes->NumberOfBits + 7) / 8;
if(pBetTable->pNameHashes != NULL)
memcpy(pBetTable->pNameHashes->Elements, pbSrcData, LengthInBytes);
- pbSrcData += pBetHeader->dwNameHashArraySize;
+// pbSrcData += pBetHeader->dwNameHashArraySize;
// Dump both tables
// DumpHetAndBetTable(ha->pHetTable, pBetTable);
@@ -1592,7 +1592,7 @@ TMPQExtHeader * TranslateBetTable(
// Write the array of BET hashes
LengthInBytes = (pBitArray->NumberOfBits + 7) / 8;
memcpy(pbTrgData, pBitArray->Elements, LengthInBytes);
- pbTrgData += LengthInBytes;
+// pbTrgData += LengthInBytes;
// Free the bit array
STORM_FREE(pBitArray);
@@ -2726,6 +2726,7 @@ int RebuildFileTable(TMPQArchive * ha, DWORD dwNewHashTableSize, DWORD dwNewMaxF
// Set the new tables to the MPQ archive
ha->pFileTable = pFileTable;
ha->pHashTable = pHashTable;
+ pFileTable = NULL;
// Set the new limits to the MPQ archive
ha->pHeader->dwHashTableSize = dwNewHashTableSize;
@@ -2763,6 +2764,8 @@ int RebuildFileTable(TMPQArchive * ha, DWORD dwNewHashTableSize, DWORD dwNewMaxF
STORM_FREE(pOldFileTable);
if(pOldHashTable != NULL)
STORM_FREE(pOldHashTable);
+ if(pFileTable != NULL)
+ STORM_FREE(pFileTable);
return nError;
}