vcl/source/outdev/textline.cxx | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit b7e8b6b476aced3ea5f0c455a5fcc3824ea9ee5b
Author: Caolán McNamara <[email protected]>
AuthorDate: Sun Apr 24 21:22:47 2022 +0100
Commit: Michael Stahl <[email protected]>
CommitDate: Mon May 16 12:50:53 2022 +0200
ofz#46905 Null-dereference
Change-Id: I26427ee1e010ce79e40c550459d9f53598570a7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133291
Tested-by: Jenkins
Reviewed-by: Michael Stahl <[email protected]>
(cherry picked from commit 5f1d341779b9a773e3147542f6b80d4b3547bb43)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133930
Tested-by: Michael Stahl <[email protected]>
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)