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.
pull/3294/head
Ryan Styrczula 2020-06-22 17:19:26 -04:00
parent c70d57be4f
commit 5717ea466f
1 changed files with 1 additions and 0 deletions

View File

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