sc/source/filter/rtf/eeimpars.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit a047583f76cd5e9d6ba73ec1ed0ede6cfc3dd541 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Fri Feb 10 10:50:24 2023 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Feb 13 11:05:43 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/+/146746 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> 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++ )