summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-08 10:11:04 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-08 10:41:07 +0000
commitf12b4be44d8e490b7816206236bb628b20602716 (patch)
treeafbce6f3abbdb55b54e526a05e3ff5858667449f /vcl
parentfb107f15b28cdba3e7a92d10cb44d85d6c933743 (diff)
coverity#707560 Uninitialized scalar variable
Change-Id: Ia041c86a689f92795298ee16922ab42734820ec6
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/fontsubset/fontsubset.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/vcl/source/fontsubset/fontsubset.cxx b/vcl/source/fontsubset/fontsubset.cxx
index 4eca8a4be76f..3e496b18426f 100644
--- a/vcl/source/fontsubset/fontsubset.cxx
+++ b/vcl/source/fontsubset/fontsubset.cxx
@@ -128,9 +128,10 @@ bool FontSubsetInfo::CreateFontSubsetFromSfnt( sal_Int32* pOutGlyphWidths )
// handle SFNT_TTF fonts
// by forwarding the subset request to AG's sft subsetter
#if 1 // TODO: remove conversion tp 16bit glyphids when sft-subsetter has been updated
- sal_uInt16 aShortGlyphIds[256];
- for( int i = 0; i < mnReqGlyphCount; ++i)
- aShortGlyphIds[i] = (sal_uInt16)mpReqGlyphIds[i];
+ std::vector<sal_uInt16> aShortGlyphIds;
+ aShortGlyphIds.reserve(mnReqGlyphCount);
+ for (int i = 0; i < mnReqGlyphCount; ++i)
+ aShortGlyphIds.push_back((sal_uInt16)mpReqGlyphIds[i]);
// remove const_cast when sft-subsetter is const-correct
sal_uInt8* pEncArray = const_cast<sal_uInt8*>( mpReqEncodedIds );
#endif
@@ -138,12 +139,12 @@ bool FontSubsetInfo::CreateFontSubsetFromSfnt( sal_Int32* pOutGlyphWidths )
if( (mnReqFontTypeMask & TYPE42_FONT) != 0 )
{
nSFTErr = CreateT42FromTTGlyphs( mpSftTTFont, mpOutFile, mpReqFontName,
- aShortGlyphIds, pEncArray, mnReqGlyphCount );
+ aShortGlyphIds.data(), pEncArray, mnReqGlyphCount );
}
else if( (mnReqFontTypeMask & TYPE3_FONT) != 0 )
{
nSFTErr = CreateT3FromTTGlyphs( mpSftTTFont, mpOutFile, mpReqFontName,
- aShortGlyphIds, pEncArray, mnReqGlyphCount,
+ aShortGlyphIds.data(), pEncArray, mnReqGlyphCount,
0 /* 0 = horizontal, 1 = vertical */ );
}
else if( (mnReqFontTypeMask & SFNT_TTF) != 0 )