summaryrefslogtreecommitdiff
path: root/src/primitives.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/primitives.cc')
-rw-r--r--src/primitives.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/primitives.cc b/src/primitives.cc
index 89c1573..13a6794 100644
--- a/src/primitives.cc
+++ b/src/primitives.cc
@@ -513,8 +513,12 @@ sphere_next_r2:
if (this->paths.toVector().size() == 0)
{
+ if (dd.points.size() <= 2) { // Ignore malformed polygons
+ delete p;
+ return NULL;
+ }
dd.paths.push_back(DxfData::Path());
- for (size_t i=0; i<this->points.toVector().size(); i++) {
+ for (size_t i=0; i<dd.points.size(); i++) {
assert(i < dd.points.size()); // FIXME: Not needed, but this used to be an 'if'
dd.paths.back().indices.push_back(i);
}
contact: Jan Huwald // Impressum