Skip to content

Commit

Permalink
RMF: Fix delta compression with non-initialized elevation min-max (OS…
Browse files Browse the repository at this point in the history
  • Loading branch information
drons committed Sep 1, 2021
1 parent 86d711e commit ecd9506
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gdal/frmts/rmf/rmfdem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,12 @@ size_t RMFDataset::DEMCompress(const GByte* pabyIn, GUInt32 nSizeIn,
const GUInt32 anDeltaTypeSize[8] = {0,0,4,8,12,16,24,32};
const GUInt32 nMaxRecordSize = 255 + 32;

DEMWorkT iMin((poDS == nullptr) ? std::numeric_limits<DEMWorkT>::min() :
static_cast<DEMWorkT>(poDS->sHeader.adfElevMinMax[0]));

DEMWorkT iMin(std::numeric_limits<DEMWorkT>::min() + 1);
if(poDS != nullptr &&
poDS->sHeader.adfElevMinMax[0] < poDS->sHeader.adfElevMinMax[1])
{
iMin = static_cast<DEMWorkT>(poDS->sHeader.adfElevMinMax[0]);
}
GUInt32 nLessCount = 0;
GUInt32 nRecordSize = 0;
RmfTypes eRecordType = TYPE_OUT;
Expand Down

0 comments on commit ecd9506

Please sign in to comment.