diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-01-04 03:27:01 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-01-04 03:35:28 +0100 |
commit | ec6b0cb9da208d520972b3f305ecd79fdddb9023 (patch) | |
tree | 94e2a44c007a7a16b8c3df5692498e45702a6b18 | |
parent | 8c71d6855fec68d2c65627f5bd47d1156c656405 (diff) |
don't overflow SCCOL during repeated cell import, fdo#58539
This is the fix for the third and last crash with gnome#627150
Change-Id: Iaf8611500fdb485017814b35789332c6c89530c0
-rw-r--r-- | sc/source/filter/xml/xmlcelli.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 186cea8b0822..d58b9f587ad4 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -167,7 +167,8 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport, nMatrixRows = static_cast<SCROW>(sValue.toInt32()); break; case XML_TOK_TABLE_ROW_CELL_ATTR_REPEATED: - nColsRepeated = static_cast<SCCOL>(std::max( sValue.toInt32(), static_cast<sal_Int32>(1) )); + nColsRepeated = static_cast<SCCOL>(std::min<sal_Int32>( MAXCOLCOUNT, + std::max( sValue.toInt32(), static_cast<sal_Int32>(1) ) )); break; case XML_TOK_TABLE_ROW_CELL_ATTR_VALUE_TYPE: nCellType = GetScImport().GetCellType(sValue); |