summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-13 11:22:58 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-01-13 11:22:58 +0000
commit0198f54d25e6ec939ca4f341169d0c90d47b56d1 (patch)
tree8a83032dc8f8ff55a17c97cf9fc5975791299b6b /vcl
parentb78d6544eb7751af55ea302535efe42650d26353 (diff)
longparas: make OutputDevice::GetGlyphBoundRects safe
Change-Id: I3dbb42b14a03c5bd98ebc1f67963ffe4c5e4b6b8
Diffstat (limited to 'vcl')
-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++ )