Fix MemoryStream::EnsureCapacity

This commit is contained in:
Ted John 2017-02-08 21:53:37 +00:00
parent d124f4fad0
commit ad1634631f
1 changed files with 3 additions and 1 deletions

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);
}
}