[GRASS-SVN] r69228 - grass/branches/releasebranch_7_2/imagery/i.group

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 23 05:23:23 PDT 2016


Author: martinl
Date: 2016-08-23 05:23:23 -0700 (Tue, 23 Aug 2016)
New Revision: 69228

Modified:
   grass/branches/releasebranch_7_2/imagery/i.group/main.c
Log:
i.group segfaults on empty input (see #1705) (merge r69227 from trunk)

Modified: grass/branches/releasebranch_7_2/imagery/i.group/main.c
===================================================================
--- grass/branches/releasebranch_7_2/imagery/i.group/main.c	2016-08-23 12:19:21 UTC (rev 69227)
+++ grass/branches/releasebranch_7_2/imagery/i.group/main.c	2016-08-23 12:23:23 UTC (rev 69228)
@@ -215,6 +215,10 @@
 
     for (m = 0; m < k; m++) {
 	skip = 0;
+        if (!rasters[m]) {
+            G_warning(_("No input raster maps defined"));
+            return 0;
+        }
 	if ((mapset = G_find_raster(rasters[m], "")) == NULL) {
 	    G_warning(_("Raster map <%s> not found. Skipped."), rasters[m]);
             skip = 1;



More information about the grass-commit mailing list