Skip to content

Commit

Permalink
Fix : null pointer crash (#8326)
Browse files Browse the repository at this point in the history
seker authored Dec 30, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 757e3c5 commit 8c1e028
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEW_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -7,3 +7,4 @@ for next branch cut* header.
appropriate header in [RELEASE_NOTES.md](./RELEASE_NOTES.md).

## Release notes for next branch cut
fix crash: the 'target_node' of Animation Channel may be nullpointer.
3 changes: 3 additions & 0 deletions libs/gltfio/src/Animator.cpp
Original file line number Diff line number Diff line change
@@ -408,6 +408,9 @@ void AnimatorImpl::addChannels(const FixedCapacityVector<Entity>& nodeMap,
const Sampler* samplers = dst.samplers.data();
for (cgltf_size j = 0, nchans = srcAnim.channels_count; j < nchans; ++j) {
const cgltf_animation_channel& srcChannel = srcChannels[j];
if (!srcChannel.target_node) {
continue;
}
Entity targetEntity = nodeMap[srcChannel.target_node - nodes];
if (UTILS_UNLIKELY(!targetEntity)) {
if (GLTFIO_VERBOSE) {

0 comments on commit 8c1e028

Please sign in to comment.