Skip to content

Commit 05cdd52

Browse files
committedSep 6, 2011
Add zero pointer checks to avoid segfaults
1 parent 67dfd2e commit 05cdd52

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎src/core/qgspallabeling.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,10 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, const QgsRenderContext
495495
}
496496

497497
QgsGeometry* geom = f.geometry();
498+
if ( !geom )
499+
{
500+
return;
501+
}
498502

499503
if ( ct ) // reproject the geometry if necessary
500504
geom->transform( *ct );
@@ -511,6 +515,10 @@ void QgsPalLayerSettings::registerFeature( QgsFeature& f, const QgsRenderContext
511515
if ( do_clip )
512516
{
513517
geomClipped = geom->intersection( extentGeom ); // creates new geometry
518+
if ( !geomClipped )
519+
{
520+
return;
521+
}
514522
geos_geom = geomClipped->asGeos();
515523
}
516524
else

0 commit comments

Comments
 (0)
Please sign in to comment.