[GRASS-SVN] r60694 - grass/branches/releasebranch_7_0/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jun 3 12:18:22 PDT 2014


Author: hcho
Date: 2014-06-03 12:18:22 -0700 (Tue, 03 Jun 2014)
New Revision: 60694

Modified:
   grass/branches/releasebranch_7_0/lib/vector/Vlib/level_two.c
Log:
Vect_get_centroid_area(): fix seg fault with no centroid (merged from r60691)

Modified: grass/branches/releasebranch_7_0/lib/vector/Vlib/level_two.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/vector/Vlib/level_two.c	2014-06-03 19:11:35 UTC (rev 60693)
+++ grass/branches/releasebranch_7_0/lib/vector/Vlib/level_two.c	2014-06-03 19:18:22 UTC (rev 60694)
@@ -437,7 +437,7 @@
 
     check_level(Map);
     
-    if (Map->plus.Line[centroid]->type != GV_CENTROID)
+    if (centroid == 0 || Map->plus.Line[centroid]->type != GV_CENTROID)
 	return 0;
     
     topo = (struct P_topo_c *)Map->plus.Line[centroid]->topo;



More information about the grass-commit mailing list