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 11:32:18 +0200 |
commit | f248b99b6f7f93b5170b4c50d7827fa0dd23421e (patch) | |
tree | 267a1af127e319896af3a458b6145a33bbc9f1c9 | |
parent | 1f335ad91f9df58268aa97a2b6297a9578380037 (diff) |
ofz: Use-of-uninitialized-value
Change-Id: I9ca24a135494a49449aec63615b2d945a93e8b27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133717
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-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 4b5e209b7680..b8b599cbc5ba 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -1089,7 +1089,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 ) |