[GRASS-SVN] r31618 - grass/trunk/imagery/i.atcorr
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jun 3 16:25:54 EDT 2008
Author: neteler
Date: 2008-06-03 16:25:53 -0400 (Tue, 03 Jun 2008)
New Revision: 31618
Modified:
grass/trunk/imagery/i.atcorr/main.cpp
Log:
don't access elements of vis and alt without checking that those arrays have been allocated
Modified: grass/trunk/imagery/i.atcorr/main.cpp
===================================================================
--- grass/trunk/imagery/i.atcorr/main.cpp 2008-06-03 19:07:04 UTC (rev 31617)
+++ grass/trunk/imagery/i.atcorr/main.cpp 2008-06-03 20:25:53 UTC (rev 31618)
@@ -301,8 +301,9 @@
/* loop over all the values in the row */
for(col = 0; col < G_window_cols(); col++)
{
- if(isnan(vis[col]) || isnan(alt[col]) || isnan(buf[col])) {buf[col] = FP_NAN; continue;}
- alt[col] /= 1000.0f; /* converting to km from input which should be in meter */
+/* TODO: use G_set_f_null_value()?? */
+ if(vis && isnan(vis[col]) || alt && isnan(alt[col]) || isnan(buf[col])) {buf[col] = FP_NAN; continue;}
+ alt[col] /= 1000.0f; /* converting to km from input which should be in meter */
/* check if both maps are active and if whether any value has changed */
if((ialt_fd >= 0) && (ivis_fd >= 0) && ((prev_vis != vis[col]) || (prev_alt != alt[col])))
More information about the grass-commit
mailing list