mirror of https://github.com/PCSX2/pcsx2.git
SaveState: Bounds check FreezeMem loads
This commit is contained in:
parent
4ad1355af3
commit
93652a3115
|
@ -315,6 +315,9 @@ memLoadingState::memLoadingState(const VmStateBuffer& load_from)
|
||||||
// Loading of state data from a memory buffer...
|
// Loading of state data from a memory buffer...
|
||||||
void memLoadingState::FreezeMem( void* data, int size )
|
void memLoadingState::FreezeMem( void* data, int size )
|
||||||
{
|
{
|
||||||
|
if (m_idx + size > m_memory.size())
|
||||||
|
m_error = true;
|
||||||
|
|
||||||
if (m_error)
|
if (m_error)
|
||||||
{
|
{
|
||||||
std::memset(data, 0, size);
|
std::memset(data, 0, size);
|
||||||
|
|
Loading…
Reference in New Issue