浏览代码

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.
Andrew Parlane 9 年之前
父节点
当前提交
3c4e06c23f
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      code/ObjFileMtlImporter.cpp

+ 1 - 0
code/ObjFileMtlImporter.cpp

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