Explorar o código

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 %!s(int64=6) %!d(string=hai) anos
pai
achega
deb9b44268
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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 */
 
 	/*