Bug 527289 - crash [@ nsHyperTextAccessible::ScrollSubstringToPoint(int, int, unsigned int, int, int)]. r=surkov,MarcoZ

This commit is contained in:
David Bolter 2009-11-10 09:07:19 -05:00
parent a71f9dd073
commit 486a4b94e9

View File

@ -2032,6 +2032,11 @@ nsHyperTextAccessible::ScrollSubstringToPoint(PRInt32 aStartIndex,
presContext->DevPixelsToAppUnits(devOffsetY));
nsSize size(parentFrame->GetSize());
// avoid divide by zero
size.width = size.width ? size.width : 1;
size.height = size.height ? size.height : 1;
PRInt16 hPercent = offsetPoint.x * 100 / size.width;
PRInt16 vPercent = offsetPoint.y * 100 / size.height;