diff --git a/NEW_RELEASE_NOTES.md b/NEW_RELEASE_NOTES.md index 4a1a9c7fa7e4..ee533ab0189a 100644 --- a/NEW_RELEASE_NOTES.md +++ b/NEW_RELEASE_NOTES.md @@ -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. \ No newline at end of file diff --git a/libs/gltfio/src/Animator.cpp b/libs/gltfio/src/Animator.cpp index 0d8b667644b1..7b1bd6eb2508 100644 --- a/libs/gltfio/src/Animator.cpp +++ b/libs/gltfio/src/Animator.cpp @@ -408,6 +408,9 @@ void AnimatorImpl::addChannels(const FixedCapacityVector& 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) {