1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 22:13:07 +01:00

Fix MemoryStream::EnsureCapacity

This commit is contained in:
Ted John
2017-02-08 21:53:37 +00:00
parent d124f4fad0
commit ad1634631f

View File

@@ -178,7 +178,9 @@ void MemoryStream::EnsureCapacity(size_t capacity)
newCapacity *= 2;
}
uint64 position = GetPosition();
_dataCapacity = newCapacity;
Memory::Reallocate(_data, _dataCapacity);
_data = Memory::Reallocate(_data, _dataCapacity);
_position = (void *)((uintptr_t)_data + (uintptr_t)position);
}
}