[GRASS-SVN] r73219 - grass/trunk/raster/r.horizon

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Aug 31 10:28:38 PDT 2018


Author: mmetz
Date: 2018-08-31 10:28:38 -0700 (Fri, 31 Aug 2018)
New Revision: 73219

Modified:
   grass/trunk/raster/r.horizon/main.c
Log:
r.horizon: check if coordinates are within the current region, fixes #3634

Modified: grass/trunk/raster/r.horizon/main.c
===================================================================
--- grass/trunk/raster/r.horizon/main.c	2018-08-31 15:17:20 UTC (rev 73218)
+++ grass/trunk/raster/r.horizon/main.c	2018-08-31 17:28:38 UTC (rev 73219)
@@ -367,6 +367,11 @@
 		_("Can't read the coordinates from the \"coordinate\" option."));
 	}
 
+	if (xcoord < cellhd.west || xcoord >= cellhd.east ||
+	    ycoord <= cellhd.south || ycoord > cellhd.north) {
+	    G_fatal_error(_("Coordinates are outside of the current region"));
+	}
+
 	/* Transform the coordinates to row/column */
 
 	/*



More information about the grass-commit mailing list