浏览代码

Fix NaN check in GDAL (r.external) support
(merge https://trac.osgeo.org/grass/changeset/65602 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@65603 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 9 年之前
父节点
当前提交
50ad81ea03
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      lib/raster/get_row.c

+ 2 - 1
lib/raster/get_row.c

@@ -902,7 +902,8 @@ static void get_null_value_row_gdal(int fd, char *flags, int row)
     for (i = 0; i < R__.rd_window.cols; i++)
     for (i = 0; i < R__.rd_window.cols; i++)
 	/* note: using == won't work if the null value is NaN */
 	/* note: using == won't work if the null value is NaN */
 	flags[i] = !fcb->col_map[i] ||
 	flags[i] = !fcb->col_map[i] ||
-	    memcmp(&tmp_buf[i], &fcb->gdal->null_val, sizeof(DCELL)) == 0;
+	    tmp_buf[i] == fcb->gdal->null_val ||
+	    tmp_buf[i] != tmp_buf[i];
 
 
     G_free(tmp_buf);
     G_free(tmp_buf);
 }
 }