From 802f2c88af919b18f08bf4568964ad7087bf9e8a Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 1 Sep 2016 13:48:04 +0200 Subject: 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 --- vcl/source/gdi/dibtools.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx index cf3f68660513..8814965eee89 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); -- cgit