Bug 1194859 - crash in mozilla::a11y::ARIAGridCellAccessible::GroupPosition, r=marcoz

This commit is contained in:
Alexander Surkov 2015-08-18 20:38:24 -04:00
parent 2ffea2bfd7
commit 8fb432dbc3
2 changed files with 6 additions and 4 deletions

View File

@ -690,8 +690,9 @@ GroupPos
ARIAGridCellAccessible::GroupPosition()
{
int32_t count = 0, index = 0;
if (nsCoreUtils::GetUIntAttr(Table()->AsAccessible()->GetContent(),
nsGkAtoms::aria_colcount, &count) &&
Accessible* table = Table()->AsAccessible();
if (table && nsCoreUtils::GetUIntAttr(table->GetContent(),
nsGkAtoms::aria_colcount, &count) &&
nsCoreUtils::GetUIntAttr(mContent, nsGkAtoms::aria_colindex, &index)) {
return GroupPos(0, index, count);
}

View File

@ -147,8 +147,9 @@ GroupPos
HTMLTableCellAccessible::GroupPosition()
{
int32_t count = 0, index = 0;
if (nsCoreUtils::GetUIntAttr(Table()->AsAccessible()->GetContent(),
nsGkAtoms::aria_colcount, &count) &&
Accessible* table = Table()->AsAccessible();
if (table && nsCoreUtils::GetUIntAttr(table->GetContent(),
nsGkAtoms::aria_colcount, &count) &&
nsCoreUtils::GetUIntAttr(mContent, nsGkAtoms::aria_colindex, &index)) {
return GroupPos(0, index, count);
}