Added another nullptr safety check

pull/4055/head
Max Vollmer (Microsoft Havok) 2021-09-02 08:27:03 +01:00
parent 155db25883
commit 4c86772091
1 changed files with 11 additions and 0 deletions

View File

@ -1337,6 +1337,17 @@ std::unordered_map<unsigned int, AnimationSamplers> GatherSamplers(Animation &an
}
auto& animsampler = anim.samplers[channel.sampler];
if (!animsampler.input) {
ASSIMP_LOG_WARN("Animation ", anim.name, ": Missing sampler input. Skipping.");
continue;
}
if (!animsampler.output) {
ASSIMP_LOG_WARN("Animation ", anim.name, ": Missing sampler output. Skipping.");
continue;
}
if (animsampler.input->count > animsampler.output->count) {
ASSIMP_LOG_WARN("Animation ", anim.name, ": Number of keyframes in sampler input ", animsampler.input->count, " exceeds number of keyframes in sampler output ", animsampler.output->count);
continue;