Browse Source

https://github.com/assimp/assimp/issues/714: fix null pointer access with
unknown texture.

Kim Kulling 9 years ago
parent
commit
9409ce3b56
1 changed files with 3 additions and 1 deletions
  1. 3 1
      code/ObjFileMtlImporter.cpp

+ 3 - 1
code/ObjFileMtlImporter.cpp

@@ -358,7 +358,9 @@ void ObjFileMtlImporter::getTexture() {
 
     std::string texture;
     m_DataIt = getName<DataArrayIt>( m_DataIt, m_DataItEnd, texture );
-    out->Set( texture );
+    if ( NULL!=out ) {
+        out->Set( texture );
+    }
 }
 
 /* /////////////////////////////////////////////////////////////////////////////