mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
check if bonesCount is 0 to avoid bad memory access
This commit is contained in:
parent
457cd46c49
commit
f3b7cacf02
@ -65,7 +65,7 @@ spSkeleton* spSkeleton_create (spSkeletonData* data) {
|
||||
}
|
||||
self->bones[i] = spBone_create(boneData, self, parent);
|
||||
}
|
||||
CONST_CAST(spBone*, self->root) = self->bones[0];
|
||||
CONST_CAST(spBone*, self->root) = (self->bonesCount > 0 ? self->bones[0] : NULL);
|
||||
|
||||
self->slotsCount = data->slotsCount;
|
||||
self->slots = MALLOC(spSlot*, self->slotsCount);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user