# Obj: add missing check for empty normals, which caused models with no or partial normal sets to fail in some cases.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1010 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
aramis_acg 2011-05-29 20:38:46 +00:00
parent d467b5bb27
commit 799ae75d67
1 changed files with 1 additions and 1 deletions

View File

@ -342,7 +342,7 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel,
pMesh->mVertices[ newIndex ] = pModel->m_Vertices[ vertex ]; pMesh->mVertices[ newIndex ] = pModel->m_Vertices[ vertex ];
// Copy all normals // Copy all normals
if ( !pSourceFace->m_pNormals->empty() ) if ( !pSourceFace->m_pNormals->empty() && !pModel->m_Normals.empty())
{ {
const unsigned int normal = pSourceFace->m_pNormals->at( vertexIndex ); const unsigned int normal = pSourceFace->m_pNormals->at( vertexIndex );
if (normal >= pModel->m_Normals.size()) { if (normal >= pModel->m_Normals.size()) {