Skip to content

Commit f383dea

Browse files
committedJun 27, 2012
Fix for bug #5877
1 parent 8304d6a commit f383dea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎src/core/qgsrasterdataprovider.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,11 @@ QgsRasterBandStats QgsRasterDataProvider::bandStatistics( int theBandNo )
255255
myXBlockSize = xBlockSize();
256256
myYBlockSize = yBlockSize();
257257

258+
if ( myXBlockSize == 0 || myYBlockSize == 0 )
259+
{
260+
return QgsRasterBandStats(); //invalid raster band stats
261+
}
262+
258263
myNXBlocks = ( xSize() + myXBlockSize - 1 ) / myXBlockSize;
259264
myNYBlocks = ( ySize() + myYBlockSize - 1 ) / myYBlockSize;
260265

0 commit comments

Comments
 (0)
Please sign in to comment.