Skip to content

Commit a9c017d

Browse files
committedJul 10, 2018
Fix crash with 2-band rasters
1 parent 2688a9d commit a9c017d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/core/raster/qgsmultibandcolorrenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ QgsRasterBlock *QgsMultiBandColorRenderer::block( int bandNo, QgsRectangle cons
228228
QRgb *outputBlockColorData = outputBlock->colorData();
229229

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

0 commit comments

Comments
 (0)
Please sign in to comment.