[GRASS-SVN] r61556 - grass/trunk/raster/r.stream.distance

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 6 14:45:43 PDT 2014


Author: hcho
Date: 2014-08-06 14:45:42 -0700 (Wed, 06 Aug 2014)
New Revision: 61556

Modified:
   grass/trunk/raster/r.stream.distance/main.c
Log:
r.stream.distance: Don't allocate too much fifo memory. Use the same size as other r.stream.* modules

Modified: grass/trunk/raster/r.stream.distance/main.c
===================================================================
--- grass/trunk/raster/r.stream.distance/main.c	2014-08-06 20:03:22 UTC (rev 61555)
+++ grass/trunk/raster/r.stream.distance/main.c	2014-08-06 21:45:42 UTC (rev 61556)
@@ -138,7 +138,7 @@
     ncols = Rast_window_cols();
     G_begin_distance_calculations();
 
-    fifo_max = 4 * nrows * ncols;
+    fifo_max = 4 * (nrows + ncols);
     fifo_points = (POINT *) G_malloc((fifo_max + 1) * sizeof(POINT));
 
     if (!segmentation) {



More information about the grass-commit mailing list