Commit ae0b10aa authored by hybrid's avatar hybrid

Fix signedness problem and avoid wrap around if too many triangles are found.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3636 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 9260fbdb
...@@ -155,11 +155,13 @@ void CSMFMeshFileLoader::loadLimb(io::IReadFile* file, SMesh* mesh, const core:: ...@@ -155,11 +155,13 @@ void CSMFMeshFileLoader::loadLimb(io::IReadFile* file, SMesh* mesh, const core::
} }
// triangles // triangles
u16 triangleCount; u32 triangleCount;
io::BinaryFile::read(file, triangleCount); // vertexCount used as temporary
mb->Indices.reallocate(mb->Indices.size() + triangleCount * 3); io::BinaryFile::read(file, vertexCount);
triangleCount=3*vertexCount;
mb->Indices.reallocate(mb->Indices.size() + triangleCount);
for (i=0; i < triangleCount*3; ++i) for (i=0; i < triangleCount; ++i)
{ {
u16 index; u16 index;
io::BinaryFile::read(file, index); io::BinaryFile::read(file, index);
......
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