[GRASS-SVN] r49078 - grass/trunk/imagery/i.vi

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Nov 3 11:43:00 EDT 2011


Author: ychemin
Date: 2011-11-03 08:43:00 -0700 (Thu, 03 Nov 2011)
New Revision: 49078

Modified:
   grass/trunk/imagery/i.vi/main.c
Log:
Fixed segfault from MSAVI parameters input collection

Modified: grass/trunk/imagery/i.vi/main.c
===================================================================
--- grass/trunk/imagery/i.vi/main.c	2011-11-03 15:30:58 UTC (rev 49077)
+++ grass/trunk/imagery/i.vi/main.c	2011-11-03 15:43:00 UTC (rev 49078)
@@ -183,9 +183,12 @@
     bluechan = input5->answer;
     chan5chan = input6->answer;
     chan7chan = input7->answer;
-    msavip1 = atof(input8->answer);
-    msavip2 = atof(input9->answer);
-    msavip3 = atof(input10->answer);
+    if(input8->answer)
+        msavip1 = atof(input8->answer);
+    if(input9->answer)
+        msavip2 = atof(input9->answer);
+    if(input10->answer)
+        msavip3 = atof(input10->answer);
     result = output->answer;
 
     if (!strcasecmp(viflag, "sr") && (!(input2->answer) || !(input3->answer)) )



More information about the grass-commit mailing list