[GRASS-SVN] r70434 - grass-addons/grass7/imagery/i.superpixels.slic
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jan 26 04:11:45 PST 2017
Author: mlennert
Date: 2017-01-26 04:11:45 -0800 (Thu, 26 Jan 2017)
New Revision: 70434
Modified:
grass-addons/grass7/imagery/i.superpixels.slic/main.c
Log:
i.superpixels.slic: allocate on the heap, not the stack (fixes #3247)
Modified: grass-addons/grass7/imagery/i.superpixels.slic/main.c
===================================================================
--- grass-addons/grass7/imagery/i.superpixels.slic/main.c 2017-01-25 13:03:18 UTC (rev 70433)
+++ grass-addons/grass7/imagery/i.superpixels.slic/main.c 2017-01-26 12:11:45 UTC (rev 70434)
@@ -350,15 +350,9 @@
memset (sigmay, 0, sizeof (double) * numk);
- /*
- double *distvec;
- distvec = G_malloc (sizeof (double) * sz);
- */
+ double *distvec;
+ distvec = G_malloc (sizeof (double) * sz);
- double distvec[sz];
-
- for( p = 0; p < sz; p++ ) distvec[p] = 1E+9;
-
invwt = 1.0/((offset/compactness)*(offset/compactness));
More information about the grass-commit
mailing list