mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-03 22:29:13 +08:00
[c] Fixed memcpy bugs, closes #771
This commit is contained in:
parent
721cbf0260
commit
a0484cc63d
@ -75,7 +75,7 @@ void _spEventQueue_ensureCapacity (_spEventQueue* self, int newElements) {
|
|||||||
_spEventQueueItem* newObjects;
|
_spEventQueueItem* newObjects;
|
||||||
self->objectsCapacity <<= 1;
|
self->objectsCapacity <<= 1;
|
||||||
newObjects = CALLOC(_spEventQueueItem, self->objectsCapacity);
|
newObjects = CALLOC(_spEventQueueItem, self->objectsCapacity);
|
||||||
memcpy(newObjects, self->objects, self->objectsCount);
|
memcpy(newObjects, self->objects, sizeof(_spEventQueueItem) * self->objectsCount);
|
||||||
FREE(self->objects);
|
FREE(self->objects);
|
||||||
self->objects = newObjects;
|
self->objects = newObjects;
|
||||||
}
|
}
|
||||||
@ -768,7 +768,7 @@ void _spAnimationState_ensureCapacityPropertyIDs(spAnimationState* self, int cap
|
|||||||
_spAnimationState* internal = SUB_CAST(_spAnimationState, self);
|
_spAnimationState* internal = SUB_CAST(_spAnimationState, self);
|
||||||
if (internal->propertyIDsCapacity < capacity) {
|
if (internal->propertyIDsCapacity < capacity) {
|
||||||
int *newPropertyIDs = CALLOC(int, capacity << 1);
|
int *newPropertyIDs = CALLOC(int, capacity << 1);
|
||||||
memcpy(newPropertyIDs, internal->propertyIDs, internal->propertyIDsCount);
|
memcpy(newPropertyIDs, internal->propertyIDs, sizeof(int) * internal->propertyIDsCount);
|
||||||
FREE(internal->propertyIDs);
|
FREE(internal->propertyIDs);
|
||||||
internal->propertyIDs = newPropertyIDs;
|
internal->propertyIDs = newPropertyIDs;
|
||||||
internal->propertyIDsCapacity = capacity << 1;
|
internal->propertyIDsCapacity = capacity << 1;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user