mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 01:06:00 +08:00
[cocos2dx] Segfault when copying old scratch buffer contents to resized buffer. Closes #1295.
This commit is contained in:
parent
088fb2ea02
commit
5c62f78ed4
@ -44,7 +44,7 @@ static size_t worldVerticesLength = 0;
|
||||
void ensureWorldVerticesCapacity(size_t capacity) {
|
||||
if (worldVerticesLength < capacity) {
|
||||
float* newWorldVertices = new float[capacity];
|
||||
memcpy(newWorldVertices, worldVertices, capacity * sizeof(float));
|
||||
memcpy(newWorldVertices, worldVertices, worldVerticesLength * sizeof(float));
|
||||
delete[] worldVertices;
|
||||
worldVertices = newWorldVertices;
|
||||
worldVerticesLength = capacity;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user