Skip to content

Commit a5224f6

Browse files
author
Vito Tringolo
committed
LoadBoneInfoGLTF add check for animation name being NULL
1 parent 29ac31f commit a5224f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rmodels.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4864,7 +4864,9 @@ static BoneInfo *LoadBoneInfoGLTF(cgltf_skin skin, int *boneCount)
48644864
for (unsigned int i = 0; i < skin.joints_count; i++)
48654865
{
48664866
cgltf_node node = *skin.joints[i];
4867-
strncpy(bones[i].name, node.name, sizeof(bones[i].name));
4867+
if (node.name != NULL) {
4868+
strncpy(bones[i].name, node.name, sizeof(bones[i].name));
4869+
}
48684870

48694871
// Find parent bone index
48704872
unsigned int parentIndex = -1;

0 commit comments

Comments
 (0)