瀏覽代碼

vlib: IPnts must be allocated first
(merge from devbr6, https://trac.osgeo.org/grass/changeset/34468)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@34469 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 年之前
父節點
當前提交
a542c7c96b
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      lib/vector/Vlib/intersect.c

+ 6 - 0
lib/vector/Vlib/intersect.c

@@ -1087,6 +1087,9 @@ static int find_cross(int id, int *arg)
 				    BPnts->y[j + 1], BPnts->z[j + 1], &x1,
 				    &y1, &z1, &x2, &y2, &z2, 0);
 
+    if (!IPnts)
+	IPnts = Vect_new_line_struct();
+    
     switch (ret) {
     case 0:
     case 5:
@@ -1139,6 +1142,9 @@ Vect_line_check_intersection(struct line_pnts *APoints,
 
     /* TODO: 3D, RE (representation error) threshold, GV_POINTS (line x point) */
 
+    if (!IPnts)
+	IPnts = Vect_new_line_struct();
+
     /* If one or both are point (Points->n_points == 1) */
     if (APoints->n_points == 1 && BPoints->n_points == 1) {
 	if (APoints->x[0] == BPoints->x[0] && APoints->y[0] == BPoints->y[0]) {