summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-10-10 12:27:32 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-10-10 12:54:16 +0100
commitb78d4c6503ff47177316685aae79cb5eaf55e33a (patch)
tree2135a92d360e3db2bf1f3e0e9dee95ba52985118 /vcl/source
parentf99743efece35bf1024a833ad0220a723b33256e (diff)
valgrind: zero padding bytes
uninitialized memory warnings on --convert-to pdf of ooo115771-3.doc Change-Id: I2dac6fe29d23d6e25c2f1d1511886d8b585e498c
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/fontsubset/sft.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 171d910ef76e..ac999a62f0d9 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2631,8 +2631,10 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID)
if (length > 0) {
const sal_uInt8* srcptr = glyf + ttf->goffsets[glyphID];
- d->ptr = static_cast<sal_uInt8*>(malloc((length + 1) & ~1)); assert(d->ptr != 0);
- memcpy( d->ptr, srcptr, length );
+ const size_t nChunkLen = ((length + 1) & ~1);
+ d->ptr = static_cast<sal_uInt8*>(malloc(nChunkLen)); assert(d->ptr != 0);
+ memcpy(d->ptr, srcptr, length);
+ memset(d->ptr + length, 0, nChunkLen - length);
d->compflag = (GetInt16( srcptr, 0, 1 ) < 0);
} else {
d->ptr = 0;