summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-13 11:22:58 +0000
committerTor Lillqvist <tml@collabora.com>2014-01-13 22:04:23 +0200
commit9b3b454bf2f8caa414942fe4d4d1a139e31b5b0d (patch)
tree74afcd987ee5ba5d0b49ba3fbcc476dc3e074472
parenta10d3e46e719756dfe8c641bb86b13a06677c4df (diff)
longparas: make OutputDevice::GetGlyphBoundRects safe
Change-Id: I3dbb42b14a03c5bd98ebc1f67963ffe4c5e4b6b8
-rw-r--r--vcl/source/gdi/outdev3.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index b888e773dbc8..0ba187bb979a 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -7185,8 +7185,19 @@ sal_Bool OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const OUString&
rVector.clear();
- if( nLen == STRING_LEN )
+ if(nLen == 0x0FFFF)
+ {
+ SAL_INFO("sal.rtl.xub",
+ "GetGlyphBoundRects Suspicious arguments nLen:" << nLen);
+ }
+
+ if( nIndex >= rStr.getLength() )
+ return false;
+
+ if( nLen < 0 || nIndex + nLen >= rStr.getLength() )
+ {
nLen = rStr.getLength() - nIndex;
+ }
Rectangle aRect;
for( int i = 0; i < nLen; i++ )