[GRASS-SVN] r61613 - grass-addons/grass7/raster3d/r3.flow

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 13 20:51:17 PDT 2014


Author: annakrat
Date: 2014-08-13 20:51:17 -0700 (Wed, 13 Aug 2014)
New Revision: 61613

Modified:
   grass-addons/grass7/raster3d/r3.flow/flowline.c
   grass-addons/grass7/raster3d/r3.flow/voxel_traversal.c
Log:
r3.flow: fix segmentation fault

Modified: grass-addons/grass7/raster3d/r3.flow/flowline.c
===================================================================
--- grass-addons/grass7/raster3d/r3.flow/flowline.c	2014-08-14 02:20:28 UTC (rev 61612)
+++ grass-addons/grass7/raster3d/r3.flow/flowline.c	2014-08-14 03:51:17 UTC (rev 61613)
@@ -210,4 +210,5 @@
 	Vect_reset_cats(cats);
 	db_free_string(&sql);
     }
+    G_free(trav_coords);
 }

Modified: grass-addons/grass7/raster3d/r3.flow/voxel_traversal.c
===================================================================
--- grass-addons/grass7/raster3d/r3.flow/voxel_traversal.c	2014-08-14 02:20:28 UTC (rev 61612)
+++ grass-addons/grass7/raster3d/r3.flow/voxel_traversal.c	2014-08-14 03:51:17 UTC (rev 61613)
@@ -87,7 +87,7 @@
 	/* reallocation for cases when the steps would be too big */
 	if (*size <= count) {
 	    *size = 2 * (*size);
-	    coordinates = G_realloc(coordinates, (*size) * sizeof(int));
+	    coordinates = G_realloc(coordinates, (*size) * 3 * sizeof(int));
 	}
     }
     *coor_count = count;



More information about the grass-commit mailing list