From fac361d710dce2cd90b3c02430cb5cf04e1ae8cf Mon Sep 17 00:00:00 2001 From: David Tardon Date: Wed, 17 May 2017 15:00:52 +0200 Subject: 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 --- src/lib/ABWStylesCollector.cpp | 4 ++-- 1 file 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(); } } -- cgit v1.2.3