Skip to content
Permalink
Browse files

Fix crash if colour for pallette is out of range

  • Loading branch information
timlinux committed Sep 12, 2012
1 parent c4fa82e commit bbf0c08e9ccab3bd51f2503be0c49bc173b89dc8
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/core/raster/qgspalettedrasterrenderer.cpp
@@ -138,7 +138,14 @@ void * QgsPalettedRasterRenderer::readBlock( int bandNo, QgsRectangle const & e
}
if ( !hasTransparency )
{
imageScanLine[j] = mColors[ val ].rgba();
if ( val < 0 || val > mNColors )
{
imageScanLine[j] = myDefaultColor;
}
else
{
imageScanLine[j] = mColors[ val ].rgba();
}
}
else
{

0 comments on commit bbf0c08

Please sign in to comment.
You can’t perform that action at this time.