Here is my workaround followed by explanation:
Code: Select all
Index: D:/Projects/Irrlicht/CXMeshFileLoader.cpp
===================================================================
--- D:/Projects/Irrlicht/CXMeshFileLoader.cpp (revision 3603)
+++ D:/Projects/Irrlicht/CXMeshFileLoader.cpp (working copy)
@@ -1024,7 +1024,8 @@
mesh.TCoords2.reallocate(mesh.Vertices.size());
u8* dataptr = (u8*) data;
const u32 size=((dataformat>>8)&0xf)*sizeof(core::vector2df);
- for (u32 j=0; j<mesh.Vertices.size(); ++j)
+ u32 boundary = (datasize << 2)/size;
+ for (u32 j=0; j<mesh.Vertices.size() && j<boundary; ++j)
{
mesh.TCoords2.push_back(*((core::vector2df*)(dataptr)));
dataptr += size;
This workaround allowed me to work with all models that were in project but in general it would be great to think about possible consequences of premature end of cycle and probably find more suitable solution.
Thanks for your attention.
P. S. I've read rules of the forum and know that I should attach file that caused the problem but unfortunately I don't have possibility to do this.