summaryrefslogtreecommitdiff
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-04-25 13:18:25 +0200
commit5f1d341779b9a773e3147542f6b80d4b3547bb43 (patch)
tree91d77bb6d8ba10426ffde868bec0bdce2940ebd8
parentf3a984d98c1e5f7319996e2d0523057a1004b81b (diff)
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>
-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 c4fcb33bf5d0..cbee3b52ddb9 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -680,6 +680,8 @@ void OutputDevice::ImplDrawStrikeoutChar( tools::Long nBaseX, tools::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)