Kaydet (Commit) b78d4c65 authored tarafından Caolán McNamara's avatar Caolán McNamara

valgrind: zero padding bytes

uninitialized memory warnings on --convert-to pdf
of ooo115771-3.doc

Change-Id: I2dac6fe29d23d6e25c2f1d1511886d8b585e498c
üst f99743ef
...@@ -2631,8 +2631,10 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID) ...@@ -2631,8 +2631,10 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID)
if (length > 0) { if (length > 0) {
const sal_uInt8* srcptr = glyf + ttf->goffsets[glyphID]; const sal_uInt8* srcptr = glyf + ttf->goffsets[glyphID];
d->ptr = static_cast<sal_uInt8*>(malloc((length + 1) & ~1)); assert(d->ptr != 0); const size_t nChunkLen = ((length + 1) & ~1);
memcpy( d->ptr, srcptr, length ); 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); d->compflag = (GetInt16( srcptr, 0, 1 ) < 0);
} else { } else {
d->ptr = 0; d->ptr = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment