[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - vcl/source
Caolán McNamara
caolanm at redhat.com
Thu Jan 26 13:59:36 UTC 2017
vcl/source/filter/wmf/winmtf.cxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 4f8205659a810e4f89ff1fc0148393aefec53f97
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Jan 21 17:13:47 2017 +0000
ofz#439 protect against 0 len text
Change-Id: Ib67284636235b0d43df626a4aeed67f2bc64b491
Reviewed-on: https://gerrit.libreoffice.org/33376
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 2228bbc..09b0521 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -1442,9 +1442,9 @@ void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, long* pDXArry, b
sal_Int32 nTextWidth;
pVDev->SetMapMode( MapMode( MAP_100TH_MM ) );
pVDev->SetFont( maFont );
- if( pDXArry )
+ const sal_uInt32 nLen = pDXArry ? rText.getLength() : 0;
+ if (nLen)
{
- sal_uInt32 nLen = rText.getLength();
nTextWidth = pVDev->GetTextWidth( OUString(rText[ nLen - 1 ]) );
if( nLen > 1 )
nTextWidth += pDXArry[ nLen - 2 ];
More information about the Libreoffice-commits
mailing list