[raster calculator] don't crash if output file has illegal size, e.g. 0x0

This commit is contained in:
Alexander Bruy 2018-01-23 10:55:41 +02:00
parent c09c301803
commit f2273c6a11

View File

@ -112,6 +112,11 @@ int QgsRasterCalculator::processCalculation( QgsFeedback *feedback )
}
gdal::dataset_unique_ptr outputDataset( openOutputFile( outputDriver ) );
if ( !outputDataset )
{
return static_cast< int >( CreateOutputError );
}
GDALSetProjection( outputDataset.get(), mOutputCrs.toWkt().toLocal8Bit().data() );
GDALRasterBandH outputRasterBand = GDALGetRasterBand( outputDataset.get(), 1 );