diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2010-11-26 17:24:17 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2010-11-26 17:24:17 +0100 |
commit | 05bc6abcc21637283b639e1e801c6041b384c9bf (patch) | |
tree | d3fd1e14896f30ab58e68bc591abf46d8c1039e2 /vcl/source/gdi/bitmap.cxx | |
parent | 0360a0ad1602f795bedea54dbae554c5769b7e61 (diff) |
vcl118: #i111868# fix an assertion
Diffstat (limited to 'vcl/source/gdi/bitmap.cxx')
-rw-r--r-- | vcl/source/gdi/bitmap.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index 074935086b0b..2d879d83a247 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -236,9 +236,13 @@ bool BitmapPalette::IsGreyPalette() const const int nEntryCount = GetEntryCount(); if( !nEntryCount ) // NOTE: an empty palette means 1:1 mapping return true; - const BitmapPalette& rGreyPalette = Bitmap::GetGreyPalette( nEntryCount ); - if( rGreyPalette == *this ) - return true; + // see above: only certain entry values will result in a valid call to GetGreyPalette + if( nEntryCount == 2 || nEntryCount == 4 || nEntryCount == 16 || nEntryCount == 256 ) + { + const BitmapPalette& rGreyPalette = Bitmap::GetGreyPalette( nEntryCount ); + if( rGreyPalette == *this ) + return true; + } // TODO: is it worth to compare the entries? return false; } |