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

Stephan Bergmann sbergman at redhat.com
Thu Sep 1 11:50:04 UTC 2016


 vcl/source/gdi/dibtools.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 802f2c88af919b18f08bf4568964ad7087bf9e8a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Sep 1 13:48:04 2016 +0200

    For Valgrind, zero out alignment bytes of 24-bit bitmap, too
    
    ...caused false warnings in CppunitTest_sw_filters_test testing
    sw/qa/core/exportdata/html/pass/cp1000068.odt
    
    Change-Id: I48943d5d4999e1b8c9a7ab50e39e65b2171b1b94

diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index cf3f686..8814965 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -1310,10 +1310,15 @@ bool ImplWriteDIBBits(SvStream& rOStm, BitmapReadAccess& rAcc, BitmapReadAccess*
                 }
                 break;
 
+                case 24:
+                {
+                    //valgrind, zero out the trailing unused alignment bytes
+                    size_t nUnusedBytes = nAlignedWidth - nWidth * 3;
+                    memset(pBuf.get() + nAlignedWidth - nUnusedBytes, 0, nUnusedBytes);
+                }
+                SAL_FALLTHROUGH;
                 // #i59239# fallback to 24 bit format, if bitcount is non-default
                 default:
-                    // FALLTHROUGH intended
-                case 24:
                 {
                     BitmapColor aPixelColor;
                     const bool bWriteAlpha(32 == nBitCount && pAccAlpha);


More information about the Libreoffice-commits mailing list