sc/source/ui/unoobj/chart2uno.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 46eb93f107df4b6d2ce1ad67dbfe386a5f12bd00
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Aug 20 09:30:25 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Wed Aug 28 14:04:06 2024 +0200

    cid#1608204 silence Overflowed integer argument
    
    Change-Id: I088af4b396a1114f00e47aa44439be9d838e2433
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172517
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 11519b2ff3ad..dbfd8887d810 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -625,8 +625,8 @@ void Chart2Positioner::calcGlueState(SCCOL nColSize, SCROW 
nRowSize)
         auto nCol2 = aData.Ref2.Col() - mnStartCol;
         SCROW nRow1 = aData.Ref1.Row() - mnStartRow;
         SCROW nRow2 = aData.Ref2.Row() - mnStartRow;
-        for (auto nCol = nCol1; nCol <= nCol2; ++nCol)
-            for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
+        for (SCCOLROW nCol = nCol1; nCol <= nCol2 && nCol >= 0; ++nCol)
+            for (SCCOLROW nRow = nRow1; nRow <= nRow2 && nRow >= 0; ++nRow)
             {
                 size_t i = nCol*nRowSize + nRow;
                 aCellStates[i] = Occupied;

Reply via email to