Skip to content

Commit f2273c6

Browse files
committedJan 23, 2018
[raster calculator] don't crash if output file has illegal size, e.g. 0x0
1 parent c09c301 commit f2273c6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎src/analysis/raster/qgsrastercalculator.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ int QgsRasterCalculator::processCalculation( QgsFeedback *feedback )
112112
}
113113

114114
gdal::dataset_unique_ptr outputDataset( openOutputFile( outputDriver ) );
115+
if ( !outputDataset )
116+
{
117+
return static_cast< int >( CreateOutputError );
118+
}
119+
115120
GDALSetProjection( outputDataset.get(), mOutputCrs.toWkt().toLocal8Bit().data() );
116121
GDALRasterBandH outputRasterBand = GDALGetRasterBand( outputDataset.get(), 1 );
117122

0 commit comments

Comments
 (0)
Please sign in to comment.