Skip to content
Permalink
Browse files

Added safety check

  • Loading branch information
mhugent committed Jan 23, 2012
1 parent 3f0c486 commit d61927c165e4d36de12c0578553421f56752e865
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/core/raster/qgsrasterrenderer.cpp
@@ -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();
}

0 comments on commit d61927c

Please sign in to comment.
You can’t perform that action at this time.