summaryrefslogtreecommitdiff
path: root/lotuswordpro/source/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-09-19 19:24:58 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-09-19 21:45:32 +0200
commit770dcb1f717d576facf31efed14bee403e1a7155 (patch)
tree1d1a8f0aa459df8f6eb3fde461d7ea9c2097dcfe /lotuswordpro/source/filter
parent0e74bba03fb99e276637335f0b3320419a4fe1c1 (diff)
ofz: avoid Timeout
Change-Id: I8c5d1e7aaf256e182c2f5dd92bb8fd4ad9bff42a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122325 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'lotuswordpro/source/filter')
-rw-r--r--lotuswordpro/source/filter/lwprowlayout.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx b/lotuswordpro/source/filter/lwprowlayout.cxx
index e37086960e2c..3b06b64efb67 100644
--- a/lotuswordpro/source/filter/lwprowlayout.cxx
+++ b/lotuswordpro/source/filter/lwprowlayout.cxx
@@ -463,10 +463,14 @@ void LwpRowLayout::SetCellSplit(sal_uInt16 nEffectRows)
{
for (LwpConnectedCellLayout* pConnCell : m_ConnCellList)
{
- sal_uInt16 nRowSpan = pConnCell->GetRowID()+pConnCell->GetNumrows();
- if ( nRowSpan > nEffectRows )
+ sal_uInt16 nRowSpan;
+ if (o3tl::checked_add(pConnCell->GetRowID(), pConnCell->GetNumrows(), nRowSpan))
+ throw std::range_error("bad span");
+ if (nRowSpan > nEffectRows)
{
- pConnCell->SetNumrows(nEffectRows - pConnCell->GetRowID());
+ if (o3tl::checked_sub(nEffectRows, pConnCell->GetRowID(), nRowSpan))
+ throw std::range_error("bad span");
+ pConnCell->SetNumrows(nRowSpan);
}
}
}