mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-09-26 00:13:14 +08:00
SPE-2725: Fix crash when loading invalid STL (#14343)
This commit is contained in:
parent
ed7b612753
commit
fa3b27d799
@ -222,6 +222,15 @@ static bool stl_read(stl_file *stl, FILE *fp, int first_facet, bool first)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
for (int j = 0; j < 3; ++j) {
|
||||||
|
for (int u = 0; u < 3; ++u) {
|
||||||
|
if (std::isnan(facet.vertex[j](u)) || std::isinf(facet.vertex[j](u))) {
|
||||||
|
BOOST_LOG_TRIVIAL(error) << "stl_read: facet " << i << ": vertex " << j << "contains invalid coordinate";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Write the facet into memory.
|
// Write the facet into memory.
|
||||||
stl->facet_start[i] = facet;
|
stl->facet_start[i] = facet;
|
||||||
stl_facet_stats(stl, facet, first);
|
stl_facet_stats(stl, facet, first);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user