[GRASS-SVN] r51332 - grass-addons/grass7/raster/r.stream.extract

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Apr 9 15:10:03 EDT 2012


Author: mmetz
Date: 2012-04-09 12:10:03 -0700 (Mon, 09 Apr 2012)
New Revision: 51332

Modified:
   grass-addons/grass7/raster/r.stream.extract/load.c
Log:
r.stream.extract: add additional safety check

Modified: grass-addons/grass7/raster/r.stream.extract/load.c
===================================================================
--- grass-addons/grass7/raster/r.stream.extract/load.c	2012-04-09 19:09:11 UTC (rev 51331)
+++ grass-addons/grass7/raster/r.stream.extract/load.c	2012-04-09 19:10:03 UTC (rev 51332)
@@ -85,6 +85,10 @@
 
 	    /* check for masked and NULL cells */
 	    if (Rast_is_null_value(ptr, ele_map_type)) {
+		if (acc_fd >= 0) {
+		    if (!Rast_is_null_value(acc_ptr, acc_map_type))
+			G_fatal_error(_("Accumulation map does not match elevation map!"));
+		}
 		FLAG_SET(flag_value_buf[c], NULLFLAG);
 		FLAG_SET(flag_value_buf[c], INLISTFLAG);
 		FLAG_SET(flag_value_buf[c], WORKEDFLAG);
@@ -112,8 +116,10 @@
 		if (acc_fd < 0)
 		    acc_value = 1;
 		else {
-		    if (Rast_is_null_value(acc_ptr, acc_map_type))
+		    if (Rast_is_null_value(acc_ptr, acc_map_type)) {
+			/* can this be ok after weighing ? */
 			G_fatal_error(_("Accumulation map does not match elevation map!"));
+		    }
 
 		    switch (acc_map_type) {
 		    case CELL_TYPE:



More information about the grass-commit mailing list