Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spine-c] Fix crash when skeleton hash or spine doesn't exist in JSON file #2270

Merged
merged 1 commit into from Apr 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions spine-c/spine-c/src/spine/SkeletonJson.c
Expand Up @@ -984,8 +984,8 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char

skeleton = Json_getItem(root, "skeleton");
if (skeleton) {
MALLOC_STR(skeletonData->hash, Json_getString(skeleton, "hash", 0));
MALLOC_STR(skeletonData->version, Json_getString(skeleton, "spine", 0));
MALLOC_STR(skeletonData->hash, Json_getString(skeleton, "hash", "0"));
MALLOC_STR(skeletonData->version, Json_getString(skeleton, "spine", "0"));
if (!string_starts_with(skeletonData->version, SPINE_VERSION_STRING)) {
char errorMsg[255];
sprintf(errorMsg, "Skeleton version %s does not match runtime version %s", skeletonData->version, SPINE_VERSION_STRING);
Expand Down