Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsupermerill <merill@free.fr>2022-08-11 03:36:51 +0300
committersupermerill <merill@free.fr>2022-09-16 17:01:43 +0300
commitda264107c71a6d9bdad486ed9a4ee67fdda9657f (patch)
tree29ac69d30d222081d0068201e69666f93c6ae4be
parenteab5d801234a595fdcc28019e2afb3b4c5fc86fa (diff)
fix empty vector access
-rw-r--r--src/libslic3r/PrintObjectSlice.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp
index a135c6569..06d029802 100644
--- a/src/libslic3r/PrintObjectSlice.cpp
+++ b/src/libslic3r/PrintObjectSlice.cpp
@@ -502,7 +502,8 @@ std::string fix_slicing_errors(LayerPtrs &layers, const std::function<void()> &t
while (! layers.empty() && (layers.front()->lslices.empty() || layers.front()->empty())) {
delete layers.front();
layers.erase(layers.begin());
- layers.front()->lower_layer = nullptr;
+ if(!layers.empty())
+ layers.front()->lower_layer = nullptr;
for (size_t i = 0; i < layers.size(); ++ i)
layers[i]->set_id(layers[i]->id() - 1);
}
@@ -697,6 +698,7 @@ ExPolygons PrintObject::_shrink_contour_holes(double contour_delta, double not_c
Polygons contours;
ExPolygons holes;
for (const Polygon& hole : ex_poly.holes) {
+ assert(hole.points.size() >= 3);
//check if convex to reduce it
// check whether first point forms a convex angle
//note: we allow a deviation of 5.7° (0.01rad = 0.57°)