Skip to content

Commit

Permalink
mapwcs20: keep compiler happy about (im)possible use of uninitialized…
Browse files Browse the repository at this point in the history
… memory
  • Loading branch information
gogglesguy committed Aug 20, 2018
1 parent d18302b commit 0bf81bb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mapwcs20.c
Original file line number Diff line number Diff line change
Expand Up @@ -2806,7 +2806,6 @@ static int msWCSGetCoverageMetadata20(layerObj *layer, wcs20coverageMetadataObj
/* set default values for interval and significant figures */
switch(cm->imagemode) {
case MS_IMAGEMODE_BYTE:
case MS_IMAGEMODE_PC256:
default_values.interval_min = 0.;
default_values.interval_max = 255.;
default_values.significant_figures = 3;
Expand All @@ -2821,6 +2820,11 @@ static int msWCSGetCoverageMetadata20(layerObj *layer, wcs20coverageMetadataObj
default_values.interval_max = FLT_MAX;
default_values.significant_figures = 12;
break;
default:
// other imagemodes are invalid (see above), just keep the compiler happy
msFreeCharArray(band_names, num_band_names);
return MS_FAILURE;
break;
}

/* lookup default interval values */
Expand Down

0 comments on commit 0bf81bb

Please sign in to comment.