summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/tool/scmatrix.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 47652d25e473..c70bf7188347 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -3065,6 +3065,10 @@ void ScVectorRefMatrix::ensureFullMatrix()
size_t nRowSize = mnRowSize;
size_t nRowEnd = mnRowStart + mnRowSize;
size_t nDataRowEnd = mpToken->GetArrayLength();
+
+ if (mnRowStart >= nDataRowEnd)
+ return;
+
if (nRowEnd > nDataRowEnd)
{
// Data array is shorter than the row size of the reference. Truncate