Explorar o código

Adding some additional check to avoid viewer crashes when the user changes the asset too fast.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@404 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
aramis_acg %!s(int64=16) %!d(string=hai) anos
pai
achega
807e2de3f4
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      tools/assimp_view/MeshRenderer.cpp

+ 3 - 0
tools/assimp_view/MeshRenderer.cpp

@@ -85,6 +85,9 @@ int CMeshRenderer::DrawSorted(unsigned int iIndex,const aiMatrix4x4& mWorld)
 	AssetHelper::MeshHelper* pcHelper = g_pcAsset->apcMeshes[iIndex]; 
 	const aiMesh* pcMesh = g_pcAsset->pcScene->mMeshes[iIndex];
 
+	if (!pcHelper || !pcMesh || !pcHelper->piIB)
+		return -5;
+
 	if (pcMesh->mPrimitiveTypes != aiPrimitiveType_TRIANGLE)
 		return DrawUnsorted(iIndex);
 	if (pcMesh->HasBones())