Forráskód Böngészése

Vect_get_centroid_area(): fix seg fault with no centroid

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@60691 15284696-431f-4ddb-bdfa-cd5b030d7da7
Huidae Cho 11 éve
szülő
commit
6cc596d622
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      lib/vector/Vlib/level_two.c

+ 1 - 1
lib/vector/Vlib/level_two.c

@@ -437,7 +437,7 @@ int Vect_get_centroid_area(const struct Map_info *Map, int centroid)
 
     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;