summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-18 09:03:23 +0000
committerMichael Stahl <mstahl@redhat.com>2017-01-18 14:07:43 +0000
commitf365db4e64d4bfcab561936787759348bcd50a7a (patch)
tree69feb0a6750b194a4b61bb9b8e377dd0cbe52c63 /vcl/source
parente0f262b998074eb493a56ff372c35b817e856b17 (diff)
ofz#419 same problem as wmf and emf
this is the *third* effective copy of this, see the other two uses of LF_FACESIZE in wmf parsing Change-Id: I475b18314784ad072fe58730c361fc5ca6e65819 Reviewed-on: https://gerrit.libreoffice.org/33256 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/svmconverter.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx
index cab6c05ea0db..7bafa7e8f0be 100644
--- a/vcl/source/gdi/svmconverter.cxx
+++ b/vcl/source/gdi/svmconverter.cxx
@@ -464,6 +464,8 @@ SVMConverter::SVMConverter( SvStream& rStm, GDIMetaFile& rMtf, sal_uLong nConver
}
}
+#define LF_FACESIZE 32
+
void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
{
const sal_uLong nPos = rIStm.Tell();
@@ -823,7 +825,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case GDI_FONT_ACTION:
{
vcl::Font aFont;
- char aName[ 32 ];
+ char aName[LF_FACESIZE+1];
sal_Int32 nWidth, nHeight;
sal_Int16 nCharSet, nFamily, nPitch, nAlign, nWeight, nUnderline, nStrikeout;
sal_Int16 nCharOrient, nLineOrient;
@@ -831,7 +833,8 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
ImplReadColor( rIStm, aActionColor ); aFont.SetColor( aActionColor );
ImplReadColor( rIStm, aActionColor ); aFont.SetFillColor( aActionColor );
- rIStm.ReadBytes( aName, 32 );
+ size_t nRet = rIStm.ReadBytes(aName, LF_FACESIZE);
+ aName[nRet] = 0;
aFont.SetFamilyName( OUString( aName, strlen(aName), rIStm.GetStreamCharSet() ) );
rIStm.ReadInt32( nWidth ).ReadInt32( nHeight );
rIStm.ReadInt16( nCharOrient ).ReadInt16( nLineOrient );