vcl/source/outdev/textline.cxx | 2 ++ 1 file changed, 2 insertions(+) New commits: commit 5f1d341779b9a773e3147542f6b80d4b3547bb43 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun Apr 24 21:22:47 2022 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Mon Apr 25 13:18:25 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 <michael.st...@allotropia.de> 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)