Skip to content
This repository was archived by the owner on Jan 2, 2023. It is now read-only.

Commit 3ef69db

Browse files
Trevor Northashkulz
authored andcommitted
Fix segfault when checking heights for pagination if table body does not have a cell at 0,0
1 parent e4c9c73 commit 3ef69db

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/3rdparty/webkit/Source/WebCore/rendering/RenderTable.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,11 @@ void RenderTable::layout()
342342
}
343343
if (m_firstBody) {
344344
// FIXME: Calculate maximum required height across all cells in first body row
345-
RenderTableCell* firstCell = m_firstBody->primaryCellAt(0, 0);
346-
if (firstCell) {
347-
requiredHeight += firstCell->contentLogicalHeight() + firstCell->paddingTop(false) + firstCell->paddingBottom(false) + vBorderSpacing();
345+
if (m_firstBody->numRows() > 0 && m_firstBody->numColumns() > 0) {
346+
RenderTableCell* firstCell = m_firstBody->primaryCellAt(0, 0);
347+
if (firstCell) {
348+
requiredHeight += firstCell->contentLogicalHeight() + firstCell->paddingTop(false) + firstCell->paddingBottom(false) + vBorderSpacing();
349+
}
348350
}
349351
}
350352
if (requiredHeight > remainingLogicalHeight) {

0 commit comments

Comments
 (0)