- Add new helper funtion to detect end of buffer.

- Bugfix Obj-loader: If material file is not ended with a newline material loader crashes: Check for end of buffer.
- Refactoring: Rename helper function isSpace to isSeparator to make sense of function much clearer!

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@461 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
kimmi
2009-08-02 17:11:38 +00:00
parent 98e53f976e
commit eda47a6f0b
5 changed files with 53 additions and 54 deletions

View File

@@ -62,7 +62,7 @@ ObjFileMtlImporter::ObjFileMtlImporter( std::vector<char> &buffer,
ai_assert( NULL != m_pModel );
if ( NULL == m_pModel->m_pDefaultMaterial )
{
m_pModel->m_pDefaultMaterial = new ObjFile::Material();
m_pModel->m_pDefaultMaterial = new ObjFile::Material;
m_pModel->m_pDefaultMaterial->MaterialName.Set( "default" );
}
load();
@@ -220,7 +220,7 @@ void ObjFileMtlImporter::getFloatValue( float &value )
// Creates a material from loaded data.
void ObjFileMtlImporter::createMaterial()
{
std::string strName;
std::string strName( "" );
m_DataIt = getName<DataArrayIt>( m_DataIt, m_DataItEnd, strName );
if ( m_DataItEnd == m_DataIt )
return;