[GRASS-SVN] r57749 - grass/trunk/lib/python/pygrass/raster

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Sep 19 00:27:11 PDT 2013


Author: zarch
Date: 2013-09-19 00:27:11 -0700 (Thu, 19 Sep 2013)
New Revision: 57749

Modified:
   grass/trunk/lib/python/pygrass/raster/__init__.py
Log:
Fix a segmentation fault when copy the segment to a map in RasterSegment class

Modified: grass/trunk/lib/python/pygrass/raster/__init__.py
===================================================================
--- grass/trunk/lib/python/pygrass/raster/__init__.py	2013-09-19 07:09:44 UTC (rev 57748)
+++ grass/trunk/lib/python/pygrass/raster/__init__.py	2013-09-19 07:27:11 UTC (rev 57749)
@@ -292,8 +292,7 @@
         for row in xrange(self._rows):
             libraster.Rast_get_row(
                 self._fd, row_buffer.p, row, self._gtype)
-            libseg.segment_put_row(ctypes.byref(self.segment.c_seg),
-                                   row_buffer.p, row)
+            self.segment.put_row(row, row_buffer)
 
     @must_be_open
     def segment2map(self):
@@ -301,8 +300,7 @@
         """
         row_buffer = Buffer((self._cols), self.mtype)
         for row in xrange(self._rows):
-            libseg.segment_get_row(ctypes.byref(self.segment.c_seg),
-                                   row_buffer.p, row)
+            row_buffer = self.segment.get_row(row, row_buffer)
             libraster.Rast_put_row(self._fd, row_buffer.p, self._gtype)
 
     @must_be_open



More information about the grass-commit mailing list