浏览代码

r.terraflow: backport fix for https://trac.osgeo.org/grass/ticket/1006 from devbr

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@42805 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 15 年之前
父节点
当前提交
f5b5f47063
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      raster/r.terraflow/filldepr.cc

+ 2 - 1
raster/r.terraflow/filldepr.cc

@@ -128,8 +128,9 @@ inmemory_fill_depression(AMI_STREAM<boundaryType> *boundaryStr,
   boundaryType* nextedge;
   boundaryType* nextedge;
   elevation_type h;
   elevation_type h;
   cclabel_type u, v, ur, vr;
   cclabel_type u, v, ur, vr;
+  off_t nitems = boundaryStr->stream_len();
   boundaryStr->seek(0);
   boundaryStr->seek(0);
-  for (size_t i=0; i< boundaryStr->stream_len(); i++) {
+  for (size_t i=0; i< nitems; i++) {
 
 
     /*read next edge*/
     /*read next edge*/
     ae = boundaryStr->read_item(&nextedge);
     ae = boundaryStr->read_item(&nextedge);