Kaynağa Gözat

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

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@881 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
aramis_acg 14 yıl önce
ebeveyn
işleme
09fbcfffd0
1 değiştirilmiş dosya ile 4 ekleme ve 3 silme
  1. 4 3
      include/aiMaterial.inl

+ 4 - 3
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;
 		}