summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-04-24 21:22:47 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2022-05-16 12:50:53 +0200
commitb7e8b6b476aced3ea5f0c455a5fcc3824ea9ee5b (patch)
treeaa4c63e67c2631433ce03bd9ebf1658248770399
parentofz#47042 previous use of static variable affecting later runs (diff)
downloadcore-b7e8b6b476aced3ea5f0c455a5fcc3824ea9ee5b.tar.gz
core-b7e8b6b476aced3ea5f0c455a5fcc3824ea9ee5b.zip
ofz#46905 Null-dereference
Change-Id: I26427ee1e010ce79e40c550459d9f53598570a7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133291 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 5f1d341779b9a773e3147542f6b80d4b3547bb43) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133930 Tested-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--vcl/source/outdev/textline.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index 571855dde2b5..0898475e90b2 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -599,6 +599,8 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
int nStrikeStrLen = (nWidth+(nStrikeoutWidth-1)) / nStrikeoutWidth;
if( nStrikeStrLen > nMaxStrikeStrLen )
nStrikeStrLen = nMaxStrikeStrLen;
+ else if (nStrikeStrLen < 0)
+ nStrikeStrLen = 0;
// build the strikeout string
for( int i = nTestStrLen; i < nStrikeStrLen; ++i)