summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Kulling <kimkulling@users.noreply.github.com>2024-04-11 11:30:36 +0100
committerGitHub <noreply@github.com>2024-04-11 11:30:36 +0100
commit85f084a4ce3b2186d25a3a6fb0482a4bfb1cd363 (patch)
treea2dc353710c568877b3bd67d7c745581b5fcb03c
parent08c1adc01584b09edf68653e12c67308ea78ca11 (diff)
Update ComputeUVMappingProcess.cpp (#5541)
* Update ComputeUVMappingProcess.cpp - closes https://github.com/assimp/assimp/issues/5540 * Update ComputeUVMappingProcess.cpp Add missing token.
-rw-r--r--code/PostProcessing/ComputeUVMappingProcess.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/code/PostProcessing/ComputeUVMappingProcess.cpp b/code/PostProcessing/ComputeUVMappingProcess.cpp
index 2aa34de28..cac51e8d0 100644
--- a/code/PostProcessing/ComputeUVMappingProcess.cpp
+++ b/code/PostProcessing/ComputeUVMappingProcess.cpp
@@ -346,16 +346,20 @@ void ComputeUVMappingProcess::Execute(aiScene *pScene) {
ASSIMP_LOG_DEBUG("GenUVCoordsProcess begin");
char buffer[1024];
- if (pScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT)
+ if (pScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) {
throw DeadlyImportError("Post-processing order mismatch: expecting pseudo-indexed (\"verbose\") vertices here");
+ }
std::list<MappingInfo> mappingStack;
- /* Iterate through all materials and search for non-UV mapped textures
- */
+ // Iterate through all materials and search for non-UV mapped textures
for (unsigned int i = 0; i < pScene->mNumMaterials; ++i) {
mappingStack.clear();
aiMaterial *mat = pScene->mMaterials[i];
+ if (mat == nullptr) {
+ ASSIMP_LOG_INFO("Material pointer in nullptr, skipping.");
+ continue;
+ }
for (unsigned int a = 0; a < mat->mNumProperties; ++a) {
aiMaterialProperty *prop = mat->mProperties[a];
if (!::strcmp(prop->mKey.data, "$tex.mapping")) {