[GRASS-SVN] r53063 - grass/trunk/imagery/i.vi
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Sep 3 02:16:10 PDT 2012
Author: ychemin
Date: 2012-09-03 02:16:10 -0700 (Mon, 03 Sep 2012)
New Revision: 53063
Modified:
grass/trunk/imagery/i.vi/gari.c
grass/trunk/imagery/i.vi/main.c
Log:
Corrected GARI and a missing free memory (NIRchan) condition
Modified: grass/trunk/imagery/i.vi/gari.c
===================================================================
--- grass/trunk/imagery/i.vi/gari.c 2012-09-02 23:09:55 UTC (rev 53062)
+++ grass/trunk/imagery/i.vi/gari.c 2012-09-03 09:16:10 UTC (rev 53063)
@@ -7,7 +7,7 @@
{
double result;
{
- result = (nirchan - (greenchan - (bluechan - redchan)))/(nirchan - (greenchan - (bluechan - redchan)));
+ result = (nirchan - (greenchan - (bluechan - redchan)))/(nirchan - (greenchan - (bluechan + redchan)));
}
return result;
}
Modified: grass/trunk/imagery/i.vi/main.c
===================================================================
--- grass/trunk/imagery/i.vi/main.c 2012-09-02 23:09:55 UTC (rev 53062)
+++ grass/trunk/imagery/i.vi/main.c 2012-09-03 09:16:10 UTC (rev 53063)
@@ -486,8 +486,10 @@
G_free(inrast_redchan);
Rast_close(infd_redchan);
- G_free(inrast_nirchan);
- Rast_close(infd_nirchan);
+ if (nirchan) {
+ G_free(inrast_nirchan);
+ Rast_close(infd_nirchan);
+ }
if (greenchan) {
G_free(inrast_greenchan);
Rast_close(infd_greenchan);
More information about the grass-commit
mailing list