mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Protect against div-by-zero when mRowHeight is zero. b=431738 r+sr=roc
This commit is contained in:
parent
86d7a7027f
commit
1d73573468
@ -397,7 +397,7 @@ nsListBoxBodyFrame::GetPrefSize(nsBoxLayoutState& aBoxLayoutState)
|
||||
NS_IMETHODIMP
|
||||
nsListBoxBodyFrame::PositionChanged(nsISupports* aScrollbar, PRInt32 aOldIndex, PRInt32& aNewIndex)
|
||||
{
|
||||
if (mScrolling)
|
||||
if (mScrolling || mRowHeight == 0)
|
||||
return NS_OK;
|
||||
|
||||
nscoord oldTwipIndex, newTwipIndex;
|
||||
@ -449,6 +449,9 @@ nsListBoxBodyFrame::PositionChanged(nsISupports* aScrollbar, PRInt32 aOldIndex,
|
||||
NS_IMETHODIMP
|
||||
nsListBoxBodyFrame::VisibilityChanged(nsISupports* aScrollbar, PRBool aVisible)
|
||||
{
|
||||
if (mRowHeight == 0)
|
||||
return NS_OK;
|
||||
|
||||
PRInt32 lastPageTopRow = GetRowCount() - (GetAvailableHeight() / mRowHeight);
|
||||
if (lastPageTopRow < 0)
|
||||
lastPageTopRow = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user