summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-18 09:03:23 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-26 16:38:46 +0000
commit844dea986644935809f6563b33589f1010c01f4f (patch)
treefcafa733db7f85ac3f6174282430352e272cfb05
parentofz#414 crash in DXFHatchEntity::EvaluateGroup (diff)
downloadcore-844dea986644935809f6563b33589f1010c01f4f.tar.gz
core-844dea986644935809f6563b33589f1010c01f4f.zip
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> (cherry picked from commit f365db4e64d4bfcab561936787759348bcd50a7a) Reviewed-on: https://gerrit.libreoffice.org/33537 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-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 50f6c6439e3b..11491ba1d562 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 );