sc/source/core/data/column.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 760ea7ee4917bf4d17054a9ce28c693275b35a4d
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Tue Oct 8 19:26:12 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Oct 9 11:12:20 2024 +0200

    cid#1607822 Overflowed constant
    
    Change-Id: I4794c2393c48121e3e88b6054a60416ccf13b273
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174708
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 2c1db80ce2c3..fe53ac7325da 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1950,11 +1950,13 @@ public:
             if (pCell->IsSharedTop())
             {
                 ScFormulaCell** pp = &(*it);
-                processSharedTop(pp, nRow, pCell->GetSharedLength());
+                SCROW nCellLen = pCell->GetSharedLength();
+                assert(nCellLen > 0);
+                processSharedTop(pp, nRow, nCellLen);
 
                 // Move to the last cell in the group, to get incremented to
                 // the next cell in the next iteration.
-                size_t nOffsetToLast = pCell->GetSharedLength() - 1;
+                size_t nOffsetToLast = nCellLen - 1;
                 std::advance(it, nOffsetToLast);
             }
         }

Reply via email to