Skip to content

Commit

Permalink
RMF: fix wrong counter decrement that caused compressed RMF to be inc…
Browse files Browse the repository at this point in the history
…orrectly decompressed (spotted and bisected by drons, OSGeo/gdal#153)

git-svn-id: https://svn.osgeo.org/gdal/trunk/gdal@35342 f0d54148-0727-0410-94bb-9a71ac55c965
  • Loading branch information
rouault committed Sep 6, 2016
1 parent 1bcb82f commit 4491841
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frmts/rmf/rmfdem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ int RMFDataset::DEMDecompress( const GByte* pabyIn, GUInt32 nSizeIn,
break;
if ( nSizeOut < nCount )
break;
nSizeIn -= (nCount + 1) / 2;
nSizeIn -= nCount / 2;
nSizeOut -= nCount;
while ( nCount-- > 0 )
{
Expand Down Expand Up @@ -205,7 +205,7 @@ int RMFDataset::DEMDecompress( const GByte* pabyIn, GUInt32 nSizeIn,
break;
if ( nSizeOut < nCount )
break;
nSizeIn -= (3 * nCount + 1) / 2;
nSizeIn -= 3 * nCount / 2;
nSizeOut -= nCount;

while ( nCount-- > 0 )
Expand Down

0 comments on commit 4491841

Please sign in to comment.