From 5d3f3281f451f50d4ec7f8ad7c910e66020f354c Mon Sep 17 00:00:00 2001 From: Tomas Maly Date: Tue, 27 Jun 2023 12:40:27 +0200 Subject: [PATCH] fix incorrect default for material::get with aiColor3D --- include/assimp/material.inl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/assimp/material.inl b/include/assimp/material.inl index 744743bc7..b7222f9c7 100644 --- a/include/assimp/material.inl +++ b/include/assimp/material.inl @@ -211,7 +211,8 @@ AI_FORCE_INLINE aiReturn aiMaterial::Get(const char* pKey,unsigned int type, unsigned int idx,aiColor3D& pOut) const { aiColor4D c; const aiReturn ret = aiGetMaterialColor(this,pKey,type,idx,&c); - pOut = aiColor3D(c.r,c.g,c.b); + if (ret == aiReturn_SUCCESS) + pOut = aiColor3D(c.r,c.g,c.b); return ret; } // ---------------------------------------------------------------------------