diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-07-27 14:31:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-07-28 13:19:31 +0200 |
commit | 01f4c0a25e4749875e27c63bfb824df6c4687535 (patch) | |
tree | 9a0359997826ee9f453411d46d02885fa7e0c24e /sc | |
parent | c37e50f5f2be3acff1ed32f1a1bf18d0ed7d6bdf (diff) |
crashtesting: std::bad_alloc on load of forum-mso-en4-123509.xlsx
this appeared in crashtesting with:
commit d15c4caabaa21e0efe3a08ffbe145390e802bab9
Date: Tue Sep 20 08:14:41 2022 -0400
tdf#123026 xlsx import: recalc optimal row height on import
rut existed as a caught exception during load before that.
Change-Id: I90405a7acb84c95bac350808b20482e5069e2fcf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154990
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 97c3d06cdf49..95596b0ed14d 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1607,7 +1607,16 @@ bool ScInterpreter::ConvertMatrixParameters() xNew = (*aMapIter).second; else { - auto pJumpMat = std::make_shared<ScJumpMatrix>( pCur->GetOpCode(), nJumpCols, nJumpRows); + std::shared_ptr<ScJumpMatrix> pJumpMat; + try + { + pJumpMat = std::make_shared<ScJumpMatrix>( pCur->GetOpCode(), nJumpCols, nJumpRows); + } + catch (const std::bad_alloc&) + { + SAL_WARN("sc.core", "std::bad_alloc in ScJumpMatrix ctor with " << nJumpCols << " columns and " << nJumpRows << " rows"); + return false; + } pJumpMat->SetAllJumps( 1.0, nStart, nNext, nStop); // pop parameters and store in ScJumpMatrix, push in JumpMatrix() ScTokenVec aParams(nParams); |