Merge pull request #523 from turol/afl-fixes

More crash fixes
This commit is contained in:
Kim Kulling
2015-06-22 16:56:51 +02:00
6 changed files with 24 additions and 7 deletions

View File

@@ -431,7 +431,9 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel,
pMesh->mTextureCoords[ 0 ][ newIndex ] = aiVector3D( coord3d.x, coord3d.y, coord3d.z );
}
ai_assert( pMesh->mNumVertices > newIndex );
if ( pMesh->mNumVertices <= newIndex ) {
throw DeadlyImportError("OBJ: bad vertex index");
}
// Get destination face
aiFace *pDestFace = &pMesh->mFaces[ outIndex ];