summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-05-02 21:17:06 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-05-03 11:32:18 +0200
commitf248b99b6f7f93b5170b4c50d7827fa0dd23421e (patch)
tree267a1af127e319896af3a458b6145a33bbc9f1c9
parent1f335ad91f9df58268aa97a2b6297a9578380037 (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.cxx2
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 )