summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-02-10 10:50:24 +0100
committerCaolán McNamara <caolanm@redhat.com>2023-02-13 11:05:43 +0000
commita047583f76cd5e9d6ba73ec1ed0ede6cfc3dd541 (patch)
treead238e8118bc971f7bb1567c171bf1f7562dddd5
parent821f4d6f0987450233e4f63e01f89484ec737258 (diff)
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/+/146746 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index b9678e2fdd5f..e9ab9175ab8f 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++ )