diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-01-13 11:22:58 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2014-01-13 22:04:23 +0200 |
commit | 9b3b454bf2f8caa414942fe4d4d1a139e31b5b0d (patch) | |
tree | 74afcd987ee5ba5d0b49ba3fbcc476dc3e074472 | |
parent | a10d3e46e719756dfe8c641bb86b13a06677c4df (diff) |
longparas: make OutputDevice::GetGlyphBoundRects safe
Change-Id: I3dbb42b14a03c5bd98ebc1f67963ffe4c5e4b6b8
-rw-r--r-- | vcl/source/gdi/outdev3.cxx | 13 |
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++ ) |