summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2017-05-17 15:00:52 +0200
committerDavid Tardon <dtardon@redhat.com>2017-05-17 15:02:08 +0200
commitfac361d710dce2cd90b3c02430cb5cf04e1ae8cf (patch)
treeaf6a13bf91e53829ebaa5f4ed063b726e29cfba9
parent2a17664d1ce065c75094a05ff29a4feded742aa7 (diff)
ofz#1254 the # of columns cannot be negative
This could cause a big allocation and extremely slow appending of millions of RVNGPropertyLists to a RVNGPropertyListVector in ABWContentCollector::_openTable, because the # of columns is cast to unsigned. Change-Id: I0d62659d15c95a2f0828eb9347f6efe1f377ef25
-rw-r--r--src/lib/ABWStylesCollector.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/ABWStylesCollector.cpp b/src/lib/ABWStylesCollector.cpp
index 24e332e..773a85b 100644
--- a/src/lib/ABWStylesCollector.cpp
+++ b/src/lib/ABWStylesCollector.cpp
@@ -160,8 +160,8 @@ void libabw::ABWStylesCollector::closeTable()
{
if (!m_ps->m_tableStates.empty())
{
- m_tableSizes[m_ps->m_tableStates.top().m_currentTableId]
- = m_ps->m_tableStates.top().m_currentTableWidth;
+ auto curWidth = m_ps->m_tableStates.top().m_currentTableWidth;
+ m_tableSizes[m_ps->m_tableStates.top().m_currentTableId] = curWidth > 0 ? curWidth : 0;
m_ps->m_tableStates.pop();
}
}