diff --git a/code/Material/MaterialSystem.cpp b/code/Material/MaterialSystem.cpp index 03d5a18a3..d0b39093b 100644 --- a/code/Material/MaterialSystem.cpp +++ b/code/Material/MaterialSystem.cpp @@ -96,12 +96,12 @@ aiReturn aiGetMaterialFloatArray(const aiMaterial* pMat, ai_real* pOut, unsigned int* pMax) { - ai_assert( pOut != NULL ); - ai_assert( pMat != NULL ); + ai_assert( pOut != nullptr ); + ai_assert( pMat != nullptr ); const aiMaterialProperty* prop; aiGetMaterialProperty(pMat,pKey,type,index, (const aiMaterialProperty**) &prop); - if (!prop) { + if ( nullptr == prop) { return AI_FAILURE; } @@ -112,9 +112,11 @@ aiReturn aiGetMaterialFloatArray(const aiMaterial* pMat, if (pMax) { iWrite = std::min(*pMax,iWrite); ; } - for (unsigned int a = 0; a < iWrite;++a) { - pOut[a] = static_cast ( reinterpret_cast(prop->mData)[a] ); + + for (unsigned int a = 0; a < iWrite; ++a) { + pOut[ a ] = static_cast ( reinterpret_cast(prop->mData)[a] ); } + if (pMax) { *pMax = iWrite; } diff --git a/test/models/PLY/cube_test.ply b/test/models/PLY/cube_test.ply index 068514afe..bb0839286 100644 --- a/test/models/PLY/cube_test.ply +++ b/test/models/PLY/cube_test.ply @@ -1,6 +1,6 @@ ply format ascii 1.0 -comment Created by Open Asset Import Library - http://assimp.sf.net (v4.1.4151146389) +comment Created by Open Asset Import Library - http://assimp.sf.net (v4.1.2760932948) element vertex 8 property float x property float y