Kaydet (Commit) ddeca090 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Eike Rathke

crashtesting: crash on converting ooo93489-1.ods to pdf

with --headless --convert-to pdf ooo93489-1.ods

probable regression from...

commit d4daad18
Author: Jan Holesovsky <kendy@collabora.com>
Date:   Mon Nov 30 10:28:43 2015 +0100

    sc interpreter: Move the code that can create a ScFullMatrix.

In that original code I see there was a check for "Data array is shorter than
the row size of the reference. Truncate it to the data" which doesn't exist
anymore. If I reintroduce that check here the crash is avoided.

Change-Id: I7c7a5979d9c14c133b05e89ce3794e6b739ca61c
Reviewed-on: https://gerrit.libreoffice.org/20794Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst ba580e07
...@@ -2994,6 +2994,16 @@ void ScVectorRefMatrix::ensureFullMatrix() ...@@ -2994,6 +2994,16 @@ void ScVectorRefMatrix::ensureFullMatrix()
size_t nColSize = rArrays.size(); size_t nColSize = rArrays.size();
mpFullMatrix.reset(new ScFullMatrix(nColSize, mnRowSize)); mpFullMatrix.reset(new ScFullMatrix(nColSize, mnRowSize));
size_t nRowSize = mnRowSize;
size_t nRowEnd = mnRowStart + mnRowSize;
size_t nDataRowEnd = mpToken->GetArrayLength();
if (nRowEnd > nDataRowEnd)
{
// Data array is shorter than the row size of the reference. Truncate
// it to the data.
nRowSize -= nRowEnd - nDataRowEnd;
}
for (size_t nCol = 0; nCol < nColSize; ++nCol) for (size_t nCol = 0; nCol < nColSize; ++nCol)
{ {
const formula::VectorRefArray& rArray = rArrays[nCol]; const formula::VectorRefArray& rArray = rArrays[nCol];
...@@ -3006,14 +3016,14 @@ void ScVectorRefMatrix::ensureFullMatrix() ...@@ -3006,14 +3016,14 @@ void ScVectorRefMatrix::ensureFullMatrix()
pNums += mnRowStart; pNums += mnRowStart;
rtl_uString** pStrs = rArray.mpStringArray; rtl_uString** pStrs = rArray.mpStringArray;
pStrs += mnRowStart; pStrs += mnRowStart;
fillMatrix(*mpFullMatrix, nCol, pNums, pStrs, mnRowSize); fillMatrix(*mpFullMatrix, nCol, pNums, pStrs, nRowSize);
} }
else else
{ {
// String cells only. // String cells only.
rtl_uString** pStrs = rArray.mpStringArray; rtl_uString** pStrs = rArray.mpStringArray;
pStrs += mnRowStart; pStrs += mnRowStart;
fillMatrix(*mpFullMatrix, nCol, pStrs, mnRowSize); fillMatrix(*mpFullMatrix, nCol, pStrs, nRowSize);
} }
} }
else if (rArray.mpNumericArray) else if (rArray.mpNumericArray)
...@@ -3021,7 +3031,7 @@ void ScVectorRefMatrix::ensureFullMatrix() ...@@ -3021,7 +3031,7 @@ void ScVectorRefMatrix::ensureFullMatrix()
// Numeric cells only. // Numeric cells only.
const double* pNums = rArray.mpNumericArray; const double* pNums = rArray.mpNumericArray;
pNums += mnRowStart; pNums += mnRowStart;
fillMatrix(*mpFullMatrix, nCol, pNums, mnRowSize); fillMatrix(*mpFullMatrix, nCol, pNums, nRowSize);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment