Skip to content

Commit

Permalink
Fixed bad_alloc exception followed by a deadlock when working with in…
Browse files Browse the repository at this point in the history
…valid geometry.

git-svn-id: http://svn.osgeo.org/qgis/branches/symbology-ng-branch@10913 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jun 12, 2009
1 parent 7100a3b commit 7523b25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/pal/layer.cpp
Expand Up @@ -347,6 +347,11 @@ void Layer::registerFeature( const char *geom_id, PalGeometry *userGeom, double
//case geos::geom::GEOS_POINT:
//case geos::geom::GEOS_LINESTRING:
//case geos::geom::GEOS_POLYGON:

// ignore invalid geometries
if ( (f->type == GEOS_LINESTRING && f->nbPoints < 2) ||
(f->type == GEOS_POLYGON && f->nbPoints < 3) )
continue;
#ifdef _DEBUG_FULL_
std::cout << "Create Feat" << std::endl;
#endif
Expand Down

0 comments on commit 7523b25

Please sign in to comment.