Update rmodels.c

resolves segfault with missing bone weights or bone IDs
This commit is contained in:
Jett 2024-12-23 19:15:42 -05:00 committed by GitHub
parent 7868d600f4
commit 130fb2a993
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2286,6 +2286,8 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame)
} }
} }
if ((mesh.boneWeights==NULL) || (mesh.boneIds==NULL)) continue; // skip if missing bone data, causes segfault without on some models
// Update all bones and boneMatrices of first mesh with bones. // Update all bones and boneMatrices of first mesh with bones.
for (int boneId = 0; boneId < anim.boneCount; boneId++) for (int boneId = 0; boneId < anim.boneCount; boneId++)
{ {