diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-09-19 19:24:58 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-09-19 21:45:32 +0200 |
commit | 770dcb1f717d576facf31efed14bee403e1a7155 (patch) | |
tree | 1d1a8f0aa459df8f6eb3fde461d7ea9c2097dcfe /lotuswordpro/source | |
parent | 0e74bba03fb99e276637335f0b3320419a4fe1c1 (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')
-rw-r--r-- | lotuswordpro/source/filter/lwprowlayout.cxx | 10 |
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); } } } |