From 3c4e06c23f552d3820d8477f3d3789465ad539c6 Mon Sep 17 00:00:00 2001 From: Andrew Parlane Date: Sat, 23 Jan 2016 13:05:03 -0400 Subject: [PATCH] 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. --- code/ObjFileMtlImporter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/ObjFileMtlImporter.cpp b/code/ObjFileMtlImporter.cpp index 7d40eef83..632f928c4 100644 --- a/code/ObjFileMtlImporter.cpp +++ b/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;