Browse Source

# OptimizeGraph: fix crash if there is no data remaining after flattening the graph and removing everything that serves no purpose.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@958 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
aramis_acg 14 years ago
parent
commit
1fcb1a1d8e
1 changed files with 5 additions and 0 deletions
  1. 5 0
      code/OptimizeGraph.cpp

+ 5 - 0
code/OptimizeGraph.cpp

@@ -303,6 +303,11 @@ void OptimizeGraphProcess::Execute( aiScene* pScene)
 
 	ai_assert(nodes.size() == 1);
 
+	if (dummy_root->mNumChildren == 0) {
+		pScene->mRootNode = NULL;
+		throw DeadlyImportError("After optimizing the scene graph, no data remains");
+	}
+
 	if (dummy_root->mNumChildren > 1) {
 		pScene->mRootNode = dummy_root;