summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-13 14:19:46 +0000
committerMichael Meeks <michael.meeks@collabora.com>2018-03-15 16:45:09 +0100
commit29d3d6735a98b80dd9fc0dbdb5274639883d08d9 (patch)
tree69b568a111aca082c2c530841c451de6bd42e368
parent63bd3beb23e1d8975cea209501c63d4c84396e26 (diff)
ofz#6891 empty vector access
Change-Id: Ic36d03d2646ebd90bea5fa91bc4dac3596a55d4a Reviewed-on: https://gerrit.libreoffice.org/51229 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--sw/qa/core/data/html/fail/ofz6891-1.html1
-rw-r--r--sw/source/filter/html/htmltab.cxx8
2 files changed, 8 insertions, 1 deletions
diff --git a/sw/qa/core/data/html/fail/ofz6891-1.html b/sw/qa/core/data/html/fail/ofz6891-1.html
new file mode 100644
index 000000000000..7d767d72a135
--- /dev/null
+++ b/sw/qa/core/data/html/fail/ofz6891-1.html
@@ -0,0 +1 @@
+<table align=left><td><table><S STYLE="position:absolute;width: 6"> \ No newline at end of file
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index f3a96c5e9278..4df09634005f 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -2599,7 +2599,11 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 nAbsAvail,
// Only tables with relative width or without width should be modified
m_pLayoutInfo->SetMustResize( m_bPrcWidth || !m_nWidth );
- m_pLayoutInfo->SetWidths();
+ SwTableLine *pLine1 = (m_pSwTable->GetTabLines())[0];
+ if (!pLine1->GetTabBoxes().empty())
+ m_pLayoutInfo->SetWidths();
+ else
+ SAL_WARN("sw.html", "no table box");
const_cast<SwTable *>(m_pSwTable)->SetHTMLTableLayout( m_pLayoutInfo );
@@ -3990,6 +3994,8 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
while( m_aContexts.size() > m_nContextStAttrMin )
{
HTMLAttrContext *pCntxt = PopContext();
+ if (!pCntxt)
+ break;
ClearContext( pCntxt );
delete pCntxt;
}