Explorar o código

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 %!s(int64=9) %!d(string=hai) anos
pai
achega
50ad81ea03
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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++)
 	/* note: using == won't work if the null value is NaN */
 	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);
 }