mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +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) {
|
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