vcl/source/gdi/bitmapex.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
New commits: commit 48106f66e4132dcc7a11a5ad18a535768b342dd4 Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Mon Jun 22 16:13:34 2020 +0200 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Wed Jun 24 07:37:02 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> (cherry picked from commit 7f75271f91862f333707aae065f40af4d96a89a9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96873 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.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