From 5717ea466f04584b157598b568c98615bea6f71f Mon Sep 17 00:00:00 2001 From: Ryan Styrczula Date: Mon, 22 Jun 2020 17:19:26 -0400 Subject: [PATCH] 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. --- code/PostProcessing/FindInvalidDataProcess.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/PostProcessing/FindInvalidDataProcess.cpp b/code/PostProcessing/FindInvalidDataProcess.cpp index 3ad2446b3..42c5a4ca9 100644 --- a/code/PostProcessing/FindInvalidDataProcess.cpp +++ b/code/PostProcessing/FindInvalidDataProcess.cpp @@ -127,6 +127,7 @@ void FindInvalidDataProcess::Execute(aiScene *pScene) { pScene->mMeshes[a] = NULL; meshMapping[a] = UINT_MAX; + out = true; continue; }