Check for null

pull/2045/head
Doron Adler 2018-05-28 16:12:54 +03:00
parent 6600446e2c
commit 323d59c7aa
1 changed files with 5 additions and 3 deletions

View File

@ -105,10 +105,12 @@ void TriangulateProcess::Execute( aiScene* pScene)
bool bHas = false;
for( unsigned int a = 0; a < pScene->mNumMeshes; a++)
{
if (pScene->mMeshes[ a ]) {
if ( TriangulateMesh( pScene->mMeshes[ a ] ) ) {
bHas = true;
}
}
}
if ( bHas ) {
DefaultLogger::get()->info( "TriangulateProcess finished. All polygons have been triangulated." );
} else {
@ -286,7 +288,7 @@ bool TriangulateProcess::TriangulateMesh( aiMesh* pMesh)
// We project it onto a plane to get a 2d triangle.
// Collect all vertices of of the polygon.
for (tmp = 0; tmp < max; ++tmp) {
for (tmp = 0; tmp < MIN(max,max_out+2); ++tmp) {
temp_verts3d[tmp] = verts[idx[tmp]];
}