Merge pull request #12685 from JosJuice/get-pointer-for-range-zero-size

Memmap: Don't show panic alert for 0 length range
This commit is contained in:
Admiral H. Curtiss 2024-04-04 21:08:53 +02:00 committed by GitHub
commit 0aa92f7a56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -409,7 +409,7 @@ u8* MemoryManager::GetPointerForRange(u32 address, size_t size) const
// Check that the beginning and end of the range are valid
u8* pointer = GetPointer(address);
if (!pointer || !GetPointer(address + u32(size) - 1))
if (pointer == nullptr || (size != 0 && GetPointer(address + u32(size) - 1) == nullptr))
{
// A panic alert has already been raised by GetPointer
return nullptr;