[3053648] Obj: segfault when first line is a material.

Add test file to reproduce the issues. Thanks to Ingo Kresse for providing the patch.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@807 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2010-08-27 12:36:02 +00:00
parent c5c5338397
commit cab35c496d
4 changed files with 2515 additions and 0 deletions

View File

@@ -633,6 +633,11 @@ void ObjFileParser::createMesh()
// Returns true, if a new mesh must be created.
bool ObjFileParser::needsNewMesh( const std::string &rMaterialName )
{
if(m_pModel->m_pCurrentMesh == 0)
{
// No mesh data yet
return true;
}
bool newMat = false;
int matIdx = getMaterialIndex( rMaterialName );
int curMatIdx = m_pModel->m_pCurrentMesh->m_uiMaterialIndex;