diff options
| author | Marius Kintel <marius@kintel.net> | 2013-10-19 21:15:25 (GMT) | 
|---|---|---|
| committer | Marius Kintel <marius@kintel.net> | 2013-10-19 21:15:25 (GMT) | 
| commit | d2a729bdfa91e2463cfb03e3177147f043ae0dc9 (patch) | |
| tree | a18fa34e5795884fd5e75e1a40e3dcd612a999a4 /src | |
| parent | 257d1f711525414038242f40796abf57e5ef9c0e (diff) | |
Ignore malformed polygons
Diffstat (limited to 'src')
| -rw-r--r-- | src/primitives.cc | 6 | 
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);  			} | 
