1
0

Merge branch 'master' into chunksparsing/structs

This commit is contained in:
Tycho
2014-05-01 11:50:40 -07:00
129 changed files with 4043 additions and 2393 deletions

View File

@@ -466,7 +466,15 @@ cWSSCompact::cPAKFile::cPAKFile(const AString & a_FileName, int a_LayerX, int a_
for (int i = 0; i < NumChunks; i++)
{
sChunkHeader * Header = new sChunkHeader;
READ(*Header);
// Here we do not use the READ macro, as it does not free the resources
// allocated with new in case of error.
if (f.Read(Header, sizeof(*Header)) != sizeof(*Header))
{
LOGERROR("ERROR READING %s FROM FILE %s (line %d); file offset %d", "Header", m_FileName.c_str(), __LINE__, f.Tell());
delete Header;
return;
}
m_ChunkHeaders.push_back(Header);
} // for i - chunk headers
@@ -795,7 +803,6 @@ void cWSSCompact::cPAKFile::UpdateChunk2To3()
++index2;
}
InChunkOffset += index2 / 2;
index2 = 0;
AString Converted(ConvertedData, ExpectedSize);