Skip to content

Commit

Permalink
Fix crash with 2-band rasters
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jul 10, 2018
1 parent 2688a9d commit a9c017d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/raster/qgsmultibandcolorrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ QgsRasterBlock *QgsMultiBandColorRenderer::block( int bandNo, QgsRectangle cons
QRgb *outputBlockColorData = outputBlock->colorData();

// faster data access to data for the common case that input data are coming from RGB image with 8-bit bands
bool hasByteRgb = ( redBlock->dataType() == Qgis::Byte && greenBlock->dataType() == Qgis::Byte && blueBlock->dataType() == Qgis::Byte );
bool hasByteRgb = ( redBlock && greenBlock && blueBlock && redBlock->dataType() == Qgis::Byte && greenBlock->dataType() == Qgis::Byte && blueBlock->dataType() == Qgis::Byte );
const quint8 *redData = nullptr, *greenData = nullptr, *blueData = nullptr;
if ( hasByteRgb )
{
Expand Down

0 comments on commit a9c017d

Please sign in to comment.