ObjFileMtlImporter: Fixed a segfault due to NULL ptr access.

We don't handle reflection textures during MTL import. This allowed a NULL
ptr to be used. Simply return in the case of a reflection texture.
pull/763/head
Andrew Parlane 2016-01-23 13:05:03 -04:00
parent df9bb8b915
commit 3c4e06c23f
1 changed files with 1 additions and 0 deletions

View File

@ -339,6 +339,7 @@ void ObjFileMtlImporter::getTexture() {
} else if(!ASSIMP_strincmp( pPtr, ReflectionTexture.c_str(), ReflectionTexture.size() ) ) { } else if(!ASSIMP_strincmp( pPtr, ReflectionTexture.c_str(), ReflectionTexture.size() ) ) {
// Reflection texture(s) // Reflection texture(s)
//Do nothing here //Do nothing here
return;
} else if (!ASSIMP_strincmp( pPtr, DisplacementTexture.c_str(), DisplacementTexture.size() ) ) { } else if (!ASSIMP_strincmp( pPtr, DisplacementTexture.c_str(), DisplacementTexture.size() ) ) {
// Displacement texture // Displacement texture
out = &m_pModel->m_pCurrentMaterial->textureDisp; out = &m_pModel->m_pCurrentMaterial->textureDisp;