sc/source/filter/rtf/eeimpars.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit d246ade4ac56cc675de56fa92e7a6bb3b7e6b431
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Fri Feb 10 10:50:24 2023 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Feb 13 14:31:23 2023 +0000

    sc: avoid divide by zero in ScEEImport::GraphicSize
    
    See 
https://crashreport.libreoffice.org/stats/signature/ScEEImport::GraphicSize(short,long,ScEEParseEntry%20*)
    
    Change-Id: Ia5acccb1118aff2486d23eabd536053e67f346ba
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146917
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/source/filter/rtf/eeimpars.cxx 
b/sc/source/filter/rtf/eeimpars.cxx
index e3cdd25adee9..8d768efa5f9f 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -528,7 +528,13 @@ bool ScEEImport::GraphicSize( SCCOL nCol, SCROW nRow, 
ScEEParseEntry* pE )
     }
     // Distribute line height difference between all affected lines
     SCROW nRowSpan = pE->nRowOverlap;
+
+    assert(nRowSpan != 0);
+    if ( nRowSpan == 0 )
+        return bHasGraphics;
+
     nHeight /= nRowSpan;
+
     if ( nHeight == 0 )
         nHeight = 1; // For definite comparison
     for ( SCROW nR = nRow; nR < nRow + nRowSpan; nR++ )

Reply via email to