Skip to content

Commit

Permalink
[raster calculator] don't crash if output file has illegal size, e.g.…
Browse files Browse the repository at this point in the history
… 0x0
  • Loading branch information
alexbruy committed Jan 23, 2018
1 parent c09c301 commit f2273c6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/analysis/raster/qgsrastercalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down

0 comments on commit f2273c6

Please sign in to comment.