vcl/source/outdev/textline.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 870ee667daa08bea0a60de40b13135da73e71e4c
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun Apr 24 21:22:47 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Apr 25 09:58:45 2022 +0200

    ofz#46905 Null-dereference
    
    Change-Id: I26427ee1e010ce79e40c550459d9f53598570a7b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133360
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index 4ea677b0bbfe..b652ce34408c 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)

Reply via email to