Fix [3148199] / crash in aiMaterial::Get<T>().
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@881 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/1/head
parent
74d9339274
commit
09fbcfffd0
|
@ -84,8 +84,9 @@ inline aiReturn aiMaterial::Get(const char* pKey,unsigned int type,
|
||||||
return AI_FAILURE;
|
return AI_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (::strcmp(prop->mData,(char*)aiPTI_Buffer)!=0)
|
if (prop->mType != aiPTI_Buffer) {
|
||||||
// return AI_FAILURE;
|
return AI_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
iNum = std::min((size_t)iNum,prop->mDataLength / sizeof(Type));
|
iNum = std::min((size_t)iNum,prop->mDataLength / sizeof(Type));
|
||||||
memcpy(pOut,prop->mData,iNum * 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;
|
return AI_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(prop->mData,(char*)aiPTI_Buffer)!=0) {
|
if (prop->mType != aiPTI_Buffer) {
|
||||||
return AI_FAILURE;
|
return AI_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue