From 09fbcfffd0f5802ca2be4d4dce7557333c451ceb Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Thu, 30 Dec 2010 17:43:04 +0000 Subject: [PATCH] Fix [3148199] / crash in aiMaterial::Get(). git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@881 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- include/aiMaterial.inl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/aiMaterial.inl b/include/aiMaterial.inl index cd9be627c..c7b6be27b 100644 --- a/include/aiMaterial.inl +++ b/include/aiMaterial.inl @@ -84,8 +84,9 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, return AI_FAILURE; } - // if (::strcmp(prop->mData,(char*)aiPTI_Buffer)!=0) - // return AI_FAILURE; + if (prop->mType != aiPTI_Buffer) { + return AI_FAILURE; + } iNum = std::min((size_t)iNum,prop->mDataLength / sizeof(Type)); memcpy(pOut,prop->mData,iNum * sizeof(Type)); @@ -110,7 +111,7 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type, return AI_FAILURE; } - if (strcmp(prop->mData,(char*)aiPTI_Buffer)!=0) { + if (prop->mType != aiPTI_Buffer) { return AI_FAILURE; }