[GRASS-SVN] r34469 - grass/trunk/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Nov 24 02:15:26 EST 2008


Author: martinl
Date: 2008-11-24 02:15:25 -0500 (Mon, 24 Nov 2008)
New Revision: 34469

Modified:
   grass/trunk/lib/vector/Vlib/intersect.c
Log:
vlib: IPnts must be allocated first
      (merge from devbr6, r34468)


Modified: grass/trunk/lib/vector/Vlib/intersect.c
===================================================================
--- grass/trunk/lib/vector/Vlib/intersect.c	2008-11-24 07:13:53 UTC (rev 34468)
+++ grass/trunk/lib/vector/Vlib/intersect.c	2008-11-24 07:15:25 UTC (rev 34469)
@@ -1087,6 +1087,9 @@
 				    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 @@
 
     /* 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]) {



More information about the grass-commit mailing list