Skip to content

Commit

Permalink
rasterize: fix crash when working buffer is larger than 2GB (fixes #1338
Browse files Browse the repository at this point in the history
)
  • Loading branch information
rouault committed Mar 12, 2019
1 parent 0b3f983 commit 573a979
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gdal/alg/gdalrasterize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ void gvBurnScanline( void *pCBData, int nY, int nXStart, int nXEnd,

unsigned char *pabyInsert =
psInfo->pabyChunkBuf
+ iBand * psInfo->nXSize * psInfo->nYSize
+ nY * psInfo->nXSize + nXStart;
+ static_cast<GSpacing>(iBand) * psInfo->nXSize * psInfo->nYSize
+ static_cast<GSpacing>(nY) * psInfo->nXSize + nXStart;

if( psInfo->eMergeAlg == GRMA_Add ) {
int nPixels = nXEnd - nXStart + 1;
Expand All @@ -113,8 +113,8 @@ void gvBurnScanline( void *pCBData, int nY, int nXStart, int nXEnd,

double *padfInsert =
(reinterpret_cast<double *>(psInfo->pabyChunkBuf))
+ iBand * psInfo->nXSize * psInfo->nYSize
+ nY * psInfo->nXSize + nXStart;
+ static_cast<GSpacing>(iBand) * psInfo->nXSize * psInfo->nYSize
+ static_cast<GSpacing>(nY) * psInfo->nXSize + nXStart;

if( psInfo->eMergeAlg == GRMA_Add ) {
while( nPixels-- > 0 )
Expand Down

0 comments on commit 573a979

Please sign in to comment.