mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 19:43:06 +01:00
Fix unmatched memory free
Before the memory of size 1 was deleted, more allocated.
This commit is contained in:
@@ -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.");
|
||||
|
||||
Reference in New Issue
Block a user