Workaround to fix crash reported in #2209

This commit is contained in:
Enrico Turri 2019-05-07 15:09:15 +02:00
parent 4418a9b926
commit 61a0ab4280
2 changed files with 10 additions and 2 deletions

View file

@ -108,6 +108,9 @@ stl_fix_normal_directions(stl_file *stl) {
if (stl->error) return;
// this may happen for malformed models, see: https://github.com/prusa3d/Slic3r/issues/2209
if (stl->stats.number_of_facets == 0) return;
/* Initialize linked list. */
head = (struct stl_normal*)malloc(sizeof(struct stl_normal));
if(head == NULL) perror("stl_fix_normal_directions");