Skip to content

Commit

Permalink
Fix crash if colour for pallette is out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed Sep 12, 2012
1 parent c4fa82e commit bbf0c08
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/raster/qgspalettedrasterrenderer.cpp
Expand Up @@ -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
{
Expand Down

0 comments on commit bbf0c08

Please sign in to comment.