Fixed an issue in the area cooker where unneeded padding is written to the file if the padding is exactly 32 bytes
This commit is contained in:
parent
c1014f4748
commit
3d6993a1ec
|
@ -277,14 +277,14 @@ void CAreaCooker::FinishBlock()
|
||||||
if (EnableCompression)
|
if (EnableCompression)
|
||||||
{
|
{
|
||||||
bool Success = CompressionUtil::CompressSegmentedData((u8*) mCompressedData.Data(), mCompressedData.Size(), CompressedBuf.data(), CompressedSize, UseZlib);
|
bool Success = CompressionUtil::CompressSegmentedData((u8*) mCompressedData.Data(), mCompressedData.Size(), CompressedBuf.data(), CompressedSize, UseZlib);
|
||||||
u32 PadBytes = (32 - (CompressedSize % 32)) & 0x3F;
|
u32 PadBytes = (32 - (CompressedSize % 32)) & 0x1F;
|
||||||
WriteCompressedData = Success && (CompressedSize + PadBytes < (u32) mCompressedData.Size());
|
WriteCompressedData = Success && (CompressedSize + PadBytes < (u32) mCompressedData.Size());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WriteCompressedData)
|
if (WriteCompressedData)
|
||||||
{
|
{
|
||||||
u32 PadBytes = 32 - (CompressedSize % 32);
|
u32 PadBytes = 32 - (CompressedSize % 32);
|
||||||
PadBytes &= 0x3F;
|
PadBytes &= 0x1F;
|
||||||
|
|
||||||
for (u32 iPad = 0; iPad < PadBytes; iPad++)
|
for (u32 iPad = 0; iPad < PadBytes; iPad++)
|
||||||
mAreaData.WriteByte(0);
|
mAreaData.WriteByte(0);
|
||||||
|
|
Loading…
Reference in New Issue