[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - vcl/source
Caolán McNamara
caolanm at redhat.com
Wed Jan 18 14:08:13 UTC 2017
vcl/source/gdi/svmconverter.cxx | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 237e4d7c6349f8a97657e055b7479158460d6ac8
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jan 18 09:03:23 2017 +0000
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/33257
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx
index 80a5104..b1a1c7a 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.Read( aName, 32 );
+ size_t nRet = rIStm.Read(aName, LF_FACESIZE);
+ aName[nRet] = 0;
aFont.SetFamilyName( OUString( aName, strlen(aName), rIStm.GetStreamCharSet() ) );
rIStm.ReadInt32( nWidth ).ReadInt32( nHeight );
rIStm.ReadInt16( nCharOrient ).ReadInt16( nLineOrient );
More information about the Libreoffice-commits
mailing list