summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-21 17:13:47 +0000
committerAndras Timar <andras.timar@collabora.com>2017-02-08 11:56:05 +0100
commit23d1c222394a5b82b806018431375bf47276f3c4 (patch)
tree96354fe2e9bf5a06d51f806583d3bd063cd965bb /vcl/source
parentedc88f5b69f4c913517db364a04556c0177fae29 (diff)
ofz#439 protect against 0 len text
Change-Id: Ib67284636235b0d43df626a4aeed67f2bc64b491 Reviewed-on: https://gerrit.libreoffice.org/33376 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 4f8205659a810e4f89ff1fc0148393aefec53f97)
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/filter/wmf/winmtf.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 711b6fa8d0dc..5881041d2333 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -1470,9 +1470,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 ];