Skip to content

Commit

Permalink
Fix #11455 take two (raster crashes)
Browse files Browse the repository at this point in the history
Thanks to Nyall for pointing this out
  • Loading branch information
wonder-sk committed Oct 23, 2014
1 parent d833c22 commit 691f4a2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/raster/qgsmultibandcolorrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ QgsRasterInterface * QgsMultiBandColorRenderer::clone() const
}
renderer->setOpacity( mOpacity );
renderer->setAlphaBand( mAlphaBand );
renderer->setRasterTransparency( new QgsRasterTransparency( *mRasterTransparency ) );
renderer->setRasterTransparency( mRasterTransparency ? new QgsRasterTransparency( *mRasterTransparency ) : 0 );

return renderer;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgspalettedrasterrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ QgsRasterInterface * QgsPalettedRasterRenderer::clone() const
QgsPalettedRasterRenderer * renderer = new QgsPalettedRasterRenderer( 0, mBand, rgbArray(), mNColors );
renderer->setOpacity( mOpacity );
renderer->setAlphaBand( mAlphaBand );
renderer->setRasterTransparency( new QgsRasterTransparency( *mRasterTransparency ) );
renderer->setRasterTransparency( mRasterTransparency ? new QgsRasterTransparency( *mRasterTransparency ) : 0 );
renderer->mLabels = mLabels;
return renderer;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgssinglebandcolordatarenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ QgsRasterInterface * QgsSingleBandColorDataRenderer::clone() const
QgsSingleBandColorDataRenderer * renderer = new QgsSingleBandColorDataRenderer( 0, mBand );
renderer->setOpacity( mOpacity );
renderer->setAlphaBand( mAlphaBand );
renderer->setRasterTransparency( new QgsRasterTransparency( *mRasterTransparency ) );
renderer->setRasterTransparency( mRasterTransparency ? new QgsRasterTransparency( *mRasterTransparency ) : 0 );
return renderer;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgssinglebandgrayrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ QgsRasterInterface * QgsSingleBandGrayRenderer::clone() const
QgsSingleBandGrayRenderer * renderer = new QgsSingleBandGrayRenderer( 0, mGrayBand );
renderer->setOpacity( mOpacity );
renderer->setAlphaBand( mAlphaBand );
renderer->setRasterTransparency( new QgsRasterTransparency( *mRasterTransparency ) );
renderer->setRasterTransparency( mRasterTransparency ? new QgsRasterTransparency( *mRasterTransparency ) : 0 );
renderer->setGradient( mGradient );
if ( mContrastEnhancement )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgssinglebandpseudocolorrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ QgsRasterInterface * QgsSingleBandPseudoColorRenderer::clone() const

renderer->setOpacity( mOpacity );
renderer->setAlphaBand( mAlphaBand );
renderer->setRasterTransparency( new QgsRasterTransparency( *mRasterTransparency ) );
renderer->setRasterTransparency( mRasterTransparency ? new QgsRasterTransparency( *mRasterTransparency ) : 0 );

return renderer;
}
Expand Down

0 comments on commit 691f4a2

Please sign in to comment.