Explorar o código

closes https://github.com/assimp/assimp/issues/1728: check if mesh is a null instance before dereferencing it.

Kim Kulling %!s(int64=7) %!d(string=hai) anos
pai
achega
5baba37414
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      code/XFileImporter.cpp

+ 4 - 0
code/XFileImporter.cpp

@@ -246,6 +246,10 @@ void XFileImporter::CreateMeshes( aiScene* pScene, aiNode* pNode, const std::vec
     for( unsigned int a = 0; a < pMeshes.size(); a++)
     for( unsigned int a = 0; a < pMeshes.size(); a++)
     {
     {
         XFile::Mesh* sourceMesh = pMeshes[a];
         XFile::Mesh* sourceMesh = pMeshes[a];
+        if ( nullptr == sourceMesh ) {
+            continue;
+        }
+
         // first convert its materials so that we can find them with their index afterwards
         // first convert its materials so that we can find them with their index afterwards
         ConvertMaterials( pScene, sourceMesh->mMaterials);
         ConvertMaterials( pScene, sourceMesh->mMaterials);