Browse Source

Fix NaN check in GDAL (r.external) support

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@65602 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 9 years ago
parent
commit
34a179bf33
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lib/raster/get_row.c

+ 2 - 1
lib/raster/get_row.c

@@ -939,7 +939,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);
 }