diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-10 12:27:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-10 12:54:16 +0100 |
commit | b78d4c6503ff47177316685aae79cb5eaf55e33a (patch) | |
tree | 2135a92d360e3db2bf1f3e0e9dee95ba52985118 /vcl | |
parent | f99743efece35bf1024a833ad0220a723b33256e (diff) |
valgrind: zero padding bytes
uninitialized memory warnings on --convert-to pdf
of ooo115771-3.doc
Change-Id: I2dac6fe29d23d6e25c2f1d1511886d8b585e498c
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/fontsubset/sft.cxx | 6 |
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; |