Skip to content

Commit

Permalink
i.vi: fix check input 'red' param arg (#1353)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmszi committed Feb 17, 2021
1 parent 34b8812 commit efeffd0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions imagery/i.vi/main.c
Expand Up @@ -291,9 +291,11 @@ int main(int argc, char *argv[])
|| !(opt.chan5->answer) || !(opt.chan7->answer)) )
G_fatal_error(_("gvi index requires blue, green, red, nir, chan5 and chan7 maps"));

infd_redchan = Rast_open_old(redchan, "");
data_type_redchan = Rast_map_type(redchan, "");
inrast_redchan = Rast_allocate_buf(data_type_redchan);
if (redchan) {
infd_redchan = Rast_open_old(redchan, "");
data_type_redchan = Rast_map_type(redchan, "");
inrast_redchan = Rast_allocate_buf(data_type_redchan);
}

if (nirchan) {
infd_nirchan = Rast_open_old(nirchan, "");
Expand Down

0 comments on commit efeffd0

Please sign in to comment.