Commit 1a45ab5d authored by hybrid's avatar hybrid

Additional check to avoid access to non-exisiting indices, by kosuha.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1307 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 897a3fa6
...@@ -282,6 +282,8 @@ bool CXMeshFileLoader::load(io::IReadFile* file) ...@@ -282,6 +282,8 @@ bool CXMeshFileLoader::load(io::IReadFile* file)
} }
} }
if (mesh->FaceMaterialIndices.size() != 0)
{
// store vertices in buffers and remember relation in verticesLinkIndex // store vertices in buffers and remember relation in verticesLinkIndex
u32* vCountArray = new u32[mesh->Buffers.size()]; u32* vCountArray = new u32[mesh->Buffers.size()];
memset(vCountArray, 0, mesh->Buffers.size()*sizeof(u32)); memset(vCountArray, 0, mesh->Buffers.size()*sizeof(u32));
...@@ -317,7 +319,7 @@ bool CXMeshFileLoader::load(io::IReadFile* file) ...@@ -317,7 +319,7 @@ bool CXMeshFileLoader::load(io::IReadFile* file)
buffer->Indices.push_back( verticesLinkIndex[ mesh->Indices[id] ] ); buffer->Indices.push_back( verticesLinkIndex[ mesh->Indices[id] ] );
} }
} }
}
for (u32 j=0;j<mesh->WeightJoint.size();++j) for (u32 j=0;j<mesh->WeightJoint.size();++j)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment