Skip to content

Commit c3e4ff7

Browse files
committedSep 12, 2012
Fixed a divde-by-zero error
1 parent 3cb4669 commit c3e4ff7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/core/raster/qgsrasteriterator.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ bool QgsRasterIterator::readNextRasterPart( int bandNumber,
6363

6464
RasterPartInfo& pInfo = partIt.value();
6565

66+
// If we started with zero cols or zero rows, just return (avoids divide by zero below)
67+
if ( 0 == pInfo.nCols || 0 == pInfo.nRows )
68+
{
69+
return false;
70+
}
71+
6672
//remove last data block
6773
// TODO: data are released somewhere else (check)
6874
//free( pInfo.data );

0 commit comments

Comments
 (0)
Please sign in to comment.