diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2015-10-16 10:36:23 +0900 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-10 12:27:31 +0000 |
commit | e3bd0951e6b8e8889aabc8640c5641ab32300517 (patch) | |
tree | f4559ee1c96ccae8703d17271a53f373ccd9f888 /vcl | |
parent | 4c34ae20ed2d36e3853ce4c5cf6bea0d7d088d6b (diff) |
vcl: Assert that a non-negative nXPos is always found
Change-Id: Ifb85cac1289af94102947b9064a8c12ca65ad43b
Reviewed-on: https://gerrit.libreoffice.org/19404
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/outdev/text.cxx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 9a745bea0db5..c37951ec8cc4 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -1124,6 +1124,7 @@ bool OutputDevice::GetCaretPositions( const OUString& rStr, long* pCaretXArray, for( i = 0; i < 2 * nLen; ++i ) if( pCaretXArray[ i ] >= 0 ) break; + assert(i < 2 * nLen); // otherwise i may go beyond the end of pCaretXArray long nXPos = pCaretXArray[ i ]; for( i = 0; i < 2 * nLen; ++i ) { |