diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-12-22 11:09:08 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-12-22 11:09:36 +0000 |
commit | 0dfc6f70ab53a773ee05664235d7c8927ab20f2c (patch) | |
tree | 1ee323412d905c2332deafe285c46f376d1f4ba4 /vcl | |
parent | b08e48166310ab8a53f06f4fee227a948416cf4a (diff) |
valgrind: stick 0 at end of successfully read data
Change-Id: Id79f68c9095ab313ac05d2c8b55df71788df81d3
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/wmf/winwmf.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx index 33a53a3c57ab..72a726ae3c47 100644 --- a/vcl/source/filter/wmf/winwmf.cxx +++ b/vcl/source/filter/wmf/winwmf.cxx @@ -884,7 +884,6 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) { Size aFontSize; char lfFaceName[LF_FACESIZE+1]; - lfFaceName[LF_FACESIZE] = 0; sal_Int16 lfEscapement = 0; sal_Int16 lfOrientation = 0; sal_Int16 lfWeight = 0; @@ -902,7 +901,8 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) pWMF->ReadUChar( aLogFont.lfClipPrecision ); pWMF->ReadUChar( aLogFont.lfQuality ); pWMF->ReadUChar( aLogFont.lfPitchAndFamily ); - pWMF->ReadBytes( lfFaceName, LF_FACESIZE ); + size_t nRet = pWMF->ReadBytes( lfFaceName, LF_FACESIZE ); + lfFaceName[nRet] = 0; aLogFont.lfWidth = aFontSize.Width(); aLogFont.lfHeight = aFontSize.Height(); aLogFont.lfEscapement = lfEscapement; |