浏览代码

vectorlib: Vect_cidx_find_all() should not allow mixing GV_AREA with other geometries, fixes https://trac.osgeo.org/grass/ticket/3235

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@74446 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 6 年之前
父节点
当前提交
6131278ecc
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      lib/vector/Vlib/cindex.c

+ 4 - 1
lib/vector/Vlib/cindex.c

@@ -54,7 +54,7 @@ static int ci_search_cat(struct Cat_index *ci, int first, int cat)
     hi = ci->n_cats - 1;
     if (first > hi)
 	return -1;
-    
+
     /* deferred test for equality */
     while (lo < hi) {
 	mid = (lo + hi) >> 1;
@@ -385,6 +385,9 @@ void Vect_cidx_find_all(const struct Map_info *Map, int layer, int type_mask,
     }
     ci = &(Map->plus.cidx[field_index]);
 
+    if ((type_mask & GV_AREA) && type_mask != GV_AREA)
+	G_fatal_error(_("Mixing IDs of areas and primitives"));
+
     idx = Vect_cidx_find_next(Map, field_index, cat,
 			      type_mask, 0, &type, &line);