Skip to content

Commit 7523b25

Browse files
author
wonder
committedJun 12, 2009
Fixed bad_alloc exception followed by a deadlock when working with invalid geometry.
git-svn-id: http://svn.osgeo.org/qgis/branches/symbology-ng-branch@10913 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎src/core/pal/layer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,11 @@ void Layer::registerFeature( const char *geom_id, PalGeometry *userGeom, double
347347
//case geos::geom::GEOS_POINT:
348348
//case geos::geom::GEOS_LINESTRING:
349349
//case geos::geom::GEOS_POLYGON:
350+
351+
// ignore invalid geometries
352+
if ( (f->type == GEOS_LINESTRING && f->nbPoints < 2) ||
353+
(f->type == GEOS_POLYGON && f->nbPoints < 3) )
354+
continue;
350355
#ifdef _DEBUG_FULL_
351356
std::cout << "Create Feat" << std::endl;
352357
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.