sc/source/core/tool/interpr5.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 035763be81b61a84a3b51d3199d0c91b9ff73b72
Author:     Bogdan Buzea <buzea.bog...@libreoffice.org>
AuthorDate: Sat Nov 23 10:31:54 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Jun 18 10:49:20 2025 +0200

    tdf#163486: PVS V1028 Possible overflow. Consider casting operands,
    
    not the result.
    
    Change-Id: Iabb1fa9561bbb6a464ba2e49393e8ad28aae8150
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177106
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index 6443737d2dcf..15f013f33fb1 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -327,8 +327,8 @@ ScMatrixRef ScInterpreter::CreateMatrixFromDoubleRef( const 
FormulaToken* pToken
         }
     }
 
-    SCSIZE nMatCols = static_cast<SCSIZE>(nCol2 - nCol1 + 1);
-    SCSIZE nMatRows = static_cast<SCSIZE>(nRow2 - nRow1 + 1);
+    SCSIZE nMatCols = static_cast<SCSIZE>(nCol2) - nCol1 + 1;
+    SCSIZE nMatRows = static_cast<SCSIZE>(nRow2) - nRow1 + 1;
 
     if (!ScMatrix::IsSizeAllocatable( nMatCols, nMatRows))
     {

Reply via email to