vcl/source/gdi/bitmapex.cxx |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 61703ea43d4043e3bb11c9cdccbcc87a1afb6e6b
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Mon Jun 22 16:13:34 2020 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Mon Jun 22 19:18:11 2020 +0200

    do not assume SalBitmap is zero-initialized (tdf#134152)
    
    This code apparently expected that bitmaps are initialized with
    the first color in the palette, but that's not guaranteed to be
    the case (fails at least with Skia and X11 'gen' bitmaps).
    
    Change-Id: Ie4f7412e0a6c4c1110fc5fbb8ab5bed3c96f652f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96864
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index cf46607f14a1..80c6879af00c 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -1035,9 +1035,9 @@ BitmapEx BitmapEx::ModifyBitmapEx(const 
basegfx::BColorModifierStack& rBColorMod
                 // clear bitmap with dest color
                 if(aChangedBitmap.GetBitCount() <= 8)
                 {
-                    // do NOT use erase; for e.g. 8bit Bitmaps, the nearest 
color to the given
-                    // erase color is determined and used -> this may be 
different from what is
-                    // wanted here. Better create a new bitmap with the needed 
color explicitly
+                    // For e.g. 8bit Bitmaps, the nearest color to the given 
erase color is
+                    // determined and used -> this may be different from what 
is wanted here.
+                    // Better create a new bitmap with the needed color 
explicitly.
                     Bitmap::ScopedReadAccess xReadAccess(aChangedBitmap);
                     OSL_ENSURE(xReadAccess, "Got no Bitmap ReadAccess ?!?");
 
@@ -1051,10 +1051,7 @@ BitmapEx BitmapEx::ModifyBitmapEx(const 
basegfx::BColorModifierStack& rBColorMod
                             &aNewPalette);
                     }
                 }
-                else
-                {
-                    aChangedBitmap.Erase(Color(pReplace->getBColor()));
-                }
+                aChangedBitmap.Erase(Color(pReplace->getBColor()));
             }
             else
             {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to