فهرست منبع

LoadBoneInfoGLTF add check for animation name being NULL (#4053)

Co-authored-by: Vito Tringolo <[email protected]>
VitoTringolo 1 سال پیش
والد
کامیت
0fc4b61906
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      src/rmodels.c

+ 1 - 1
src/rmodels.c

@@ -4864,7 +4864,7 @@ static BoneInfo *LoadBoneInfoGLTF(cgltf_skin skin, int *boneCount)
     for (unsigned int i = 0; i < skin.joints_count; i++)
     {
         cgltf_node node = *skin.joints[i];
-        strncpy(bones[i].name, node.name, sizeof(bones[i].name));
+        if (node.name != NULL) strncpy(bones[i].name, node.name, sizeof(bones[i].name));
 
         // Find parent bone index
         unsigned int parentIndex = -1;