Skip to content

Commit

Permalink
Added safety check
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jan 23, 2012
1 parent 3f0c486 commit d61927c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/raster/qgsrasterrenderer.cpp
Expand Up @@ -152,6 +152,15 @@ bool QgsRasterRenderer::readNextRasterPart( int bandNumber, double oversamplingX
{
pInfo.prj = new QgsRasterProjector( viewPort->mSrcCRS,
viewPort->mDestCRS, blockRect, nRows, nCols, 0, 0, mProvider->extent() );

// If we zoom out too much, projector srcRows / srcCols maybe 0, which can cause problems in providers
if ( pInfo.prj->srcRows() <= 0 || pInfo.prj->srcCols() <= 0 )
{
delete pInfo.prj;
pInfo.prj = 0;
return false;
}

blockRect = pInfo.prj->srcExtent();
}

Expand Down

0 comments on commit d61927c

Please sign in to comment.