[Libreoffice-commits] core.git: vcl/source

Caolán McNamara caolanm at redhat.com
Tue Apr 4 20:06:43 UTC 2017


 vcl/source/gdi/dibtools.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 81894a5f7200b4c4233e407163b7f1b00256dccb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 4 21:03:18 2017 +0100

    ofz#984 better match post-creation aBitmap.HasGreyPalette() logic
    
    i.e. Bitmap::HsGreyPalette checks that the palette has entries before calling
    Palette::IsGreyPalette
    
    Change-Id: I287647869ad615327f3119b7798f410e22140302

diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index 4cd7c5419199..123d8ce62181 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -946,7 +946,7 @@ bool ImplReadDIBBody(SvStream& rIStm, Bitmap& rBmp, AlphaMask* pBmpAlpha, sal_uL
     const BitmapPalette* pPal = &aPalette;
     //ofz#948 match the surrounding logic of case TransparentType::Bitmap of
     //ReadDIBBitmapEx but do it while reading for performance
-    const bool bIsAlpha = (nBitCount == 8 && aPalette.IsGreyPalette());
+    const bool bIsAlpha = (nBitCount == 8 && !!aPalette && aPalette.IsGreyPalette());
     const bool bForceToMonoWhileReading = (bIsMask && !bIsAlpha && nBitCount != 1);
     if (bForceToMonoWhileReading)
     {


More information about the Libreoffice-commits mailing list