[GRASS-SVN] r71046 - grass/branches/releasebranch_7_2/raster/r.quantile

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 7 09:48:31 PDT 2017


Author: neteler
Date: 2017-05-07 09:48:30 -0700 (Sun, 07 May 2017)
New Revision: 71046

Modified:
   grass/branches/releasebranch_7_2/raster/r.quantile/main.c
Log:
r.quantile: fix integer overflow (trunk, r70982)

Modified: grass/branches/releasebranch_7_2/raster/r.quantile/main.c
===================================================================
--- grass/branches/releasebranch_7_2/raster/r.quantile/main.c	2017-05-07 14:47:55 UTC (rev 71045)
+++ grass/branches/releasebranch_7_2/raster/r.quantile/main.c	2017-05-07 16:48:30 UTC (rev 71046)
@@ -18,11 +18,12 @@
 #include <grass/raster.h>
 #include <grass/glocale.h>
 
+/* TODO: replace long with either size_t or a guaranteed 64 bit integer */
 struct bin
 {
     unsigned long origin;
     DCELL min, max;
-    int base, count;
+    long base, count;
 };
 
 static int rows, cols;
@@ -34,7 +35,7 @@
 static unsigned int *slots;
 static DCELL slot_size;
 static unsigned long total;
-static int num_values;
+static size_t num_values;
 static unsigned short *slot_bins;
 static int num_bins;
 static struct bin *bins;



More information about the grass-commit mailing list