diff --git a/src/core/qgspallabeling.cpp b/src/core/qgspallabeling.cpp index 6a240787f2c3..72ed03de8267 100644 --- a/src/core/qgspallabeling.cpp +++ b/src/core/qgspallabeling.cpp @@ -1818,6 +1818,12 @@ void QgsPalLayerSettings::registerFeature( QgsVectorLayer* layer, QgsFeature& f } } + // fix invalid polygons + if ( geom->type() == QGis::Polygon && !geom->isGeosValid() ) + { + geom->fromGeos( GEOSBuffer( geom->asGeos(), 0, 0 ) ); + } + // CLIP the geometry if it is bigger than the extent // don't clip if centroid is requested for whole feature bool do_clip = false;