diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-05-02 21:17:06 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-05-03 21:16:35 +0200 |
commit | dc3b0983561f9166da9f3d48f8c64f9077193b0c (patch) | |
tree | cc65c45ee674e7254038291a834bdf7038064163 /vcl | |
parent | a0533a8d18bb902f70fd4c6418f44875eab38999 (diff) |
ofz: Use-of-uninitialized-value
Change-Id: I9ca24a135494a49449aec63615b2d945a93e8b27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133735
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/outdev/text.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index cdf7a360a6ca..303dcbb42177 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -1095,7 +1095,7 @@ void OutputDevice::GetCaretPositions( const OUString& rStr, sal_Int32* pCaretXAr for( i = 0; i < 2 * nLen; ++i ) if( pCaretXArray[ i ] >= 0 ) break; - tools::Long nXPos = pCaretXArray[ i ]; + tools::Long nXPos = (i < 2 * nLen) ? pCaretXArray[i] : -1; for( i = 0; i < 2 * nLen; ++i ) { if( pCaretXArray[ i ] >= 0 ) |