Browse Source

r.horizon: check if coordinates are within the current region, fixes https://trac.osgeo.org/grass/ticket/3634

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73219 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 6 years ago
parent
commit
deb9b44268
1 changed files with 5 additions and 0 deletions
  1. 5 0
      raster/r.horizon/main.c

+ 5 - 0
raster/r.horizon/main.c

@@ -367,6 +367,11 @@ int main(int argc, char *argv[])
 		_("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 */
 
 	/*