Explorar el Código

FindInvalidDataProcess: Mark removed meshes as "out"

There's a code path where an input scene only has a single mesh.
In this case, if ProcessMesh returns 2, we delete the mesh and move on
with the postprocessing. UpdateMeshReferences is not called and so the
deleted mesh is left dangling in nodes.

In a later step (SplitMesh in my testing), it then tries to deference a
null pointer and we explode.

With `out = true`, we can now hit the DeadlyImportError instead of a
segfault.
Ryan Styrczula hace 5 años
padre
commit
5717ea466f
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      code/PostProcessing/FindInvalidDataProcess.cpp

+ 1 - 0
code/PostProcessing/FindInvalidDataProcess.cpp

@@ -127,6 +127,7 @@ void FindInvalidDataProcess::Execute(aiScene *pScene) {
             pScene->mMeshes[a] = NULL;
 
             meshMapping[a] = UINT_MAX;
+            out = true;
             continue;
         }