Merge pull request #454 from Kabuto85/master

Fixed error reported by address sanitizer
This commit is contained in:
Mario Zechner 2016-07-18 16:17:57 +02:00 committed by GitHub
commit 839c9e832b

View File

@ -87,7 +87,7 @@ spSkeleton* spSkeleton_create (spSkeletonData* data) {
if (parent)
parent->children[parent->childrenCount++] = bone;
}
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);