mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[c] Closes #2258, check for empty skins in JSON parser
This commit is contained in:
parent
a557db3a54
commit
b0b1fe011e
@ -1354,10 +1354,9 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
skeletonData->skins[skeletonData->skinsCount++] = skin;
|
||||
if (strcmp(skin->name, "default") == 0) skeletonData->defaultSkin = skin;
|
||||
|
||||
for (attachmentsMap = Json_getItem(skinMap,
|
||||
"attachments")
|
||||
->child;
|
||||
attachmentsMap; attachmentsMap = attachmentsMap->next) {
|
||||
skinPart = Json_getItem(skinMap,"attachments");
|
||||
if (skinPart) {
|
||||
for (attachmentsMap = skinPart->child; attachmentsMap; attachmentsMap = attachmentsMap->next) {
|
||||
spSlotData *slot = spSkeletonData_findSlot(skeletonData, attachmentsMap->name);
|
||||
Json *attachmentMap;
|
||||
|
||||
@ -1392,7 +1391,8 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
}
|
||||
|
||||
sequence = readSequence(Json_getItem(attachmentMap, "sequence"));
|
||||
attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type, attachmentName,
|
||||
attachment = spAttachmentLoader_createAttachment(self->attachmentLoader, skin, type,
|
||||
attachmentName,
|
||||
path, sequence);
|
||||
if (!attachment) {
|
||||
if (self->attachmentLoader->error1) {
|
||||
@ -1572,6 +1572,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Linked meshes. */
|
||||
for (i = 0; i < internal->linkedMeshCount; ++i) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user