dmsurti / AssimpKit

A library (macOS, iOS) that converts the files supported by Assimp to Scene Kit scenes.
http://assimpkit.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
477 stars 54 forks source link

Crash Loading Large STL file - iOS-Example #76

Open kylebme opened 7 years ago

kylebme commented 7 years ago

The iOS-Example program is crashing when loading one particular large STL model (26.9 MB). I don't know if it's crashing because of the size or because the mesh is wonky, but it does open in other editors, so the importer should be able to handle weird meshes without crashing.

Running on physical iPhone 6s, iOS 11. Running version since commit (most recent at time of writing): https://github.com/dmsurti/AssimpKit/commit/8d5997c4f52ab567a978e8b0a4916b49a5694535

It gets EXC_BAD_ACCESS at line 583 in AssimpImporter.m

Some variables from the debugger:

(short []) scnIndices = {}
indicesCounter = 1
(unsigned int) mNumIndices = 3

BrainyWalt.stl.zip From: https://www.thingiverse.com/thing:828

dmsurti commented 7 years ago

@beak90 Whoops! Just like other data such as vertices etc; I have to malloc this. Will be fixed in the next patch release 1.2.1.

Thanks for reporting this with a model file.

kylebme commented 7 years ago

What's the timeline for this patch?

dmsurti commented 7 years ago

3rd or 4th week of October, with Blender support and some other fixes. Thanks.