Memmap: More error checking for Memset

It now uses the same error checking as CopyFromEmu and CopyToEmu.
This commit is contained in:
JosJuice 2015-11-27 17:13:47 +01:00
parent 5a1729877e
commit 2e3735b772
1 changed files with 6 additions and 3 deletions

View File

@ -282,9 +282,12 @@ void Memset(const u32 _Address, const u8 _iValue, const u32 _iLength)
if (_iLength == 0)
return;
u8* ptr = GetPointer(_Address);
if (ptr != nullptr)
memset(ptr, _iValue, _iLength);
if (!ValidCopyRange(_Address, _iLength))
{
PanicAlert("Invalid range in Memset. %zx bytes at 0x%08x", _iLength, _Address);
return;
}
memset(GetPointer(_Address), _iValue, _iLength);
}
std::string GetString(u32 em_address, size_t size)