[GRASS-SVN] r59738 - grass/branches/releasebranch_7_0/lib/rst/interp_float

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Apr 15 05:16:59 PDT 2014


Author: mmetz
Date: 2014-04-15 05:16:58 -0700 (Tue, 15 Apr 2014)
New Revision: 59738

Modified:
   grass/branches/releasebranch_7_0/lib/rst/interp_float/input2d.c
   grass/branches/releasebranch_7_0/lib/rst/interp_float/resout2d.c
Log:
rstlib: fix mask and region (#1775)

Modified: grass/branches/releasebranch_7_0/lib/rst/interp_float/input2d.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/rst/interp_float/input2d.c	2014-04-15 12:16:49 UTC (rev 59737)
+++ grass/branches/releasebranch_7_0/lib/rst/interp_float/input2d.c	2014-04-15 12:16:58 UTC (rev 59738)
@@ -29,7 +29,7 @@
 
 /** Creates a bitmap mask from given raster map **/
 {
-    int i, j, cfmask = 0, irev, MASKfd;
+    int i, j, cfmask = -1, irev, MASKfd;
     const char *mapsetm;
     CELL *cellmask, *MASK;
     struct BM *bitmask;
@@ -71,6 +71,11 @@
     }
     else
 	bitmask = NULL;
+    
+    if (MASKfd >= 0)
+	Rast_close(MASKfd);
+    if (cfmask >= 0)
+	Rast_close(cfmask);
 
     return bitmask;
 }

Modified: grass/branches/releasebranch_7_0/lib/rst/interp_float/resout2d.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/rst/interp_float/resout2d.c	2014-04-15 12:16:49 UTC (rev 59737)
+++ grass/branches/releasebranch_7_0/lib/rst/interp_float/resout2d.c	2014-04-15 12:16:58 UTC (rev 59738)
@@ -78,7 +78,7 @@
     Rast_set_output_window(outhd);
     mapset = G_mapset();
 
-    cell1 = Rast_allocate_f_buf();
+    cell1 = Rast_allocate_f_output_buf();
 
     if (params->elev)
 	cf1 = Rast_open_fp_new(params->elev);



More information about the grass-commit mailing list