cnr-isti-vclab / vcglib

The VCGlib is a C++, templated, no dependency, library for manipulation, processing and cleaning of triangle meshes
http://vcg.isti.cnr.it/vcglib
GNU General Public License v3.0
1.14k stars 353 forks source link

Collada import crash #23

Open DaWelter opened 7 years ago

DaWelter commented 7 years ago

Hi,

I have a problem with a particular file which crashes the collada importer. You can download it from my dropbox. My program code is also there. I was in the process of writing a little command line utility to give me the mass properties of a mesh. https://www.dropbox.com/sh/6so4j8ek3tsxd2k/AAD1z8HK-sHmPHlvNM0R_d_wa?dl=0

----- Starting the processing of /home/michael/Dropbox/bugreports/vcglib/Foot.dae ------
File Contains 1 Scenes
Scene 0 contains 1 instance_visual_scene 
instance_visual_scene 0 refers Scene 
instance_visual_scene Scene has 1 children
Processing Visual Scene child 0 - of type 'node'
Starting processing <node> with id Foot
getTrans form node with tag node
** instance_geometry with url #Foot-mesh (intial mesh size 0 0 T = 0)
**** Loading a Geometry Mesh **** (initial mesh size 0 0)
****** LoadTriangularMesh (initial mesh size 3245 0)
******    material id '' -> ''
******   but we were not able to find the corresponding image node
********* WARNING face 60, (126 126 606) is a DEGENERATE FACE!
********* WARNING face 64, (134 134 646) is a DEGENERATE FACE!
********* WARNING face 66, (137 137 666) is a DEGENERATE FACE!
********* WARNING face 76, (131 131 766) is a DEGENERATE FACE!
********* WARNING face 80, (125 125 806) is a DEGENERATE FACE!
********* WARNING face 92, (152 152 926) is a DEGENERATE FACE!
********* WARNING face 97, (177 177 976) is a DEGENERATE FACE!
********* WARNING face 104, (189 189 1046) is a DEGENERATE FACE!
********* WARNING face 119, (201 201 1196) is a DEGENERATE FACE!
********* WARNING face 127, (239 239 1276) is a DEGENERATE FACE!
********* WARNING face 128, (243 243 1286) is a DEGENERATE FACE!
********* WARNING face 133, (258 258 1336) is a DEGENERATE FACE!
********* WARNING face 137, (267 267 1376) is a DEGENERATE FACE!
********* WARNING face 151, (287 287 1516) is a DEGENERATE FACE!
********* WARNING face 163, (288 288 1636) is a DEGENERATE FACE!
********* WARNING face 190, (336 336 1906) is a DEGENERATE FACE!
********* WARNING face 231, (415 415 2316) is a DEGENERATE FACE!
********* WARNING face 258, (466 466 2586) is a DEGENERATE FACE!
mass_properties: /opt/vcglib/wrap/io_trimesh/import_dae.h:418: static vcg::tri::io::UtilDAE::DAEError vcg::tri::io::ImporterDAE<OpenMeshType>::LoadTriangularMesh(QDomNodeList&, vcg::tri::io::ImporterDAE<OpenMeshType>::ColladaMesh&, std::size_t, vcg::tri::io::InfoDAE&, QMap<QString, QString>&) [with OpenMeshType = MyMesh; std::size_t = long unsigned int]: Assertion `indvt + offset < m.vert.size()' failed.
Aborted (core dumped)

Tried the master branch and the v.1.0.1 tag with identical results.

The mesh was exported from Blender. By the Robot Designer tool, if that matters. It manages to crash Meshlab from the ubuntu 16 repo, too. So, I guess the crash not caused by user error.

Cheers, Michael

DaWelter commented 7 years ago

There is my fix attempt https://github.com/cnr-isti-vclab/vcglib/pull/24