Fix [3148199] / crash in aiMaterial::Get<T>().

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@881 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
aramis_acg 2010-12-30 17:43:04 +00:00
parent 74d9339274
commit 09fbcfffd0
1 changed files with 4 additions and 3 deletions

View File

@ -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;
}