8aeb34
diff -ru libwpd-0.10.2/src/lib/WP6ContentListener.cpp libwpd-0.10.2.new/src/lib/WP6ContentListener.cpp
8aeb34
--- libwpd-0.10.2/src/lib/WP6ContentListener.cpp	2017-09-08 18:04:25.000000000 +0100
8aeb34
+++ libwpd-0.10.2.new/src/lib/WP6ContentListener.cpp	2018-10-30 10:54:22.326697162 +0000
8aeb34
@@ -1311,7 +1311,10 @@
8aeb34
 		m_ps->m_tableDefinition.m_columnsProperties.clear();
8aeb34
 
8aeb34
 		// pull a table definition off of our stack
8aeb34
-		m_parseState->m_currentTable = m_parseState->m_tableList[m_parseState->m_nextTableIndice++];
8aeb34
+		auto index = m_parseState->m_nextTableIndice++;
8aeb34
+		if (index >= m_parseState->m_tableList.size())
8aeb34
+			throw ParseException();
8aeb34
+		m_parseState->m_currentTable = m_parseState->m_tableList[index];
8aeb34
 		if (!m_parseState->m_currentTable)
8aeb34
 			throw ParseException();
8aeb34
 		m_parseState->m_currentTable->makeBordersConsistent();
8aeb34
diff -ru libwpd-0.10.2/src/lib/WPXTable.h libwpd-0.10.2.new/src/lib/WPXTable.h
8aeb34
--- libwpd-0.10.2/src/lib/WPXTable.h	2015-12-30 08:27:30.000000000 +0000
8aeb34
+++ libwpd-0.10.2.new/src/lib/WPXTable.h	2018-10-30 10:55:41.264362182 +0000
8aeb34
@@ -92,6 +92,10 @@
8aeb34
 	{
8aeb34
 		m_tableList->push_back(table);
8aeb34
 	}
8aeb34
+	size_t size() const
8aeb34
+	{
8aeb34
+		return m_tableList->size();
8aeb34
+	}
8aeb34
 
8aeb34
 private:
8aeb34
 	void release();