mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-03 20:54:28 +00:00
DiscIO: Fix out-of-bounds access in NANDContentDataBuffer
Accessing buffer[start + size] triggers an error (and a crash) in debug builds. Using std::copy_n fixes this.
This commit is contained in:
parent
86b758d7ca
commit
3d21280ab4
@ -196,7 +196,7 @@ bool CNANDContentDataBuffer::GetRange(u32 start, u32 size, u8* buffer)
|
|||||||
if (start + size > m_buffer.size())
|
if (start + size > m_buffer.size())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
std::copy(&m_buffer[start], &m_buffer[start + size], buffer);
|
std::copy_n(&m_buffer[start], size, buffer);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user