mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix unmatched memory free
Before the memory of size 1 was deleted, more allocated.
This commit is contained in:
parent
c2dbd9968f
commit
660373cf38
|
@ -67,7 +67,7 @@ std::shared_ptr<SawyerChunk> SawyerChunkReader::ReadChunk()
|
|||
case CHUNK_ENCODING_RLECOMPRESSED:
|
||||
case CHUNK_ENCODING_ROTATE:
|
||||
{
|
||||
std::unique_ptr<uint8> compressedData = std::unique_ptr<uint8>(Memory::Allocate<uint8>(header.length));
|
||||
std::unique_ptr<uint8[]> compressedData(new uint8[header.length]);
|
||||
if (_stream->TryRead(compressedData.get(), header.length) != header.length)
|
||||
{
|
||||
throw SawyerChunkException("Corrupt chunk size.");
|
||||
|
|
Loading…
Reference in New Issue