summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-21 17:13:47 +0000
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-01-26 14:16:53 +0000
commit4d655e2df4831ab76d98d5ba8a8dc199d7bb44e4 (patch)
treece4d14a4b62cc128575afe1fd57704373ca47606
parentResolves: tdf#105351 pass matching index key to conditional format dialog (diff)
downloadcore-4d655e2df4831ab76d98d5ba8a8dc199d7bb44e4.tar.gz
core-4d655e2df4831ab76d98d5ba8a8dc199d7bb44e4.zip
ofz#439 protect against 0 len text
Change-Id: Ib67284636235b0d43df626a4aeed67f2bc64b491 Reviewed-on: https://gerrit.libreoffice.org/33375 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 033b47dd2ace4d43bf0be1a6983717adf044b0c2) Reviewed-on: https://gerrit.libreoffice.org/33535 Reviewed-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-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 36aae2884214..6bc8b7dfa551 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -1457,9 +1457,9 @@ void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, long* pDXArry, b
sal_Int32 nTextWidth;
pVDev->SetMapMode( MapMode( MapUnit::Map100thMM ) );
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 ];