Memory overlap fix proposal.
This commit is contained in:
parent
b36efa4ef4
commit
8f0ac7ceee
@ -664,7 +664,7 @@ void CScriptArray::RemoveRange(asUINT start, asUINT count)
|
||||
// Compact the elements
|
||||
// As objects in arrays of objects are not stored inline, it is safe to use memmove here
|
||||
// since we're just copying the pointers to objects and not the actual objects.
|
||||
memcpy(buffer->data + start*elementSize, buffer->data + (start + count)*elementSize, (buffer->numElements - count)*elementSize);
|
||||
memmove(buffer->data + start*elementSize, buffer->data + (start + count)*elementSize, (buffer->numElements - count)*elementSize);
|
||||
buffer->numElements -= count;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user