[GRASS-SVN] r36862 - grass/trunk/raster/r.colors

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 22 07:04:28 EDT 2009


Author: glynn
Date: 2009-04-22 07:04:27 -0400 (Wed, 22 Apr 2009)
New Revision: 36862

Modified:
   grass/trunk/raster/r.colors/stats.c
Log:
Add extra element to array to prevent max. value overrunning


Modified: grass/trunk/raster/r.colors/stats.c
===================================================================
--- grass/trunk/raster/r.colors/stats.c	2009-04-22 11:00:55 UTC (rev 36861)
+++ grass/trunk/raster/r.colors/stats.c	2009-04-22 11:04:27 UTC (rev 36862)
@@ -101,7 +101,7 @@
     statf->count = 1000;
     statf->min = min;
     statf->max = max;
-    statf->stats = G_calloc(statf->count, sizeof(unsigned long));
+    statf->stats = G_calloc(statf->count + 1, sizeof(unsigned long));
     statf->total = 0;
 
     G_verbose_message(_("Reading raster map <%s>..."),



More information about the grass-commit mailing list