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