summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authorJun Fang <jun_fang@foxitsoftware.com>2016-02-23 09:25:39 +0800
committerJun Fang <jun_fang@foxitsoftware.com>2016-02-23 09:25:39 +0800
commitd219a247dfaa697f9761ee558b58c23680509058 (patch)
treea9050bdd711b3da3fcb5ff97b99528c537bf5646 /xfa
parent6add19c6e183363f543585ce316b54ee9f50592a (diff)
downloadpdfium-d219a247dfaa697f9761ee558b58c23680509058.tar.xz
Fix a crasher in CXFA_ItemLayoutProcessor::DoLayoutTableContainer()
BUG=pdfium:408 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1719863002 .
Diffstat (limited to 'xfa')
-rw-r--r--xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp
index ed0836d539..071fe4d40f 100644
--- a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp
@@ -1521,15 +1521,16 @@ void CXFA_ItemLayoutProcessor::DoLayoutTableContainer(CXFA_Node* pLayoutNode) {
}
}
if (bMoreColumns) {
- FX_FLOAT fFinalColumnWidth = m_rgSpecifiedColumnWidths[iColCount];
- for (int32_t i = 0; i < iRowCount; i++) {
- if (!rgRowItems[i]) {
+ FX_FLOAT fFinalColumnWidth = 0.0f;
+ if (iColCount < m_rgSpecifiedColumnWidths.GetSize())
+ fFinalColumnWidth = m_rgSpecifiedColumnWidths[iColCount];
+ for (int32_t i = 0; i < iRowCount; ++i) {
+ if (!rgRowItems[i])
continue;
- }
- rgRowItemsSpan[i]--;
+ --rgRowItemsSpan[i];
rgRowItemsWidth[i] -= fFinalColumnWidth;
}
- iColCount++;
+ ++iColCount;
}
}
}