mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 10:42:36 +01:00
parent
f8e9ea45ba
commit
4c7fc8a70a
@ -696,13 +696,16 @@ namespace fs
|
|||||||
{
|
{
|
||||||
const u64 old_size = obj.size();
|
const u64 old_size = obj.size();
|
||||||
|
|
||||||
if (old_size + size < old_size)
|
if (old_size + size < old_size || pos + size < pos)
|
||||||
{
|
{
|
||||||
xovfl();
|
xovfl();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pos > old_size)
|
if (pos > old_size)
|
||||||
{
|
{
|
||||||
|
// Reserve memory
|
||||||
|
obj.reserve(pos + size);
|
||||||
|
|
||||||
// Fill gap if necessary (default-initialized)
|
// Fill gap if necessary (default-initialized)
|
||||||
obj.resize(pos);
|
obj.resize(pos);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user