mirror of https://github.com/PCSX2/pcsx2.git
HeapArray: Avoid writing out of bounds in internal_resize
This commit is contained in:
parent
550da21015
commit
d48c3cfce5
|
@ -362,7 +362,7 @@ private:
|
||||||
|
|
||||||
if (prev_ptr)
|
if (prev_ptr)
|
||||||
{
|
{
|
||||||
std::memcpy(m_data, prev_ptr, prev_size * sizeof(T));
|
std::memcpy(m_data, prev_ptr, std::min(size, prev_size) * sizeof(T));
|
||||||
std::free(prev_ptr);
|
std::free(prev_ptr);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue