mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Use NSCoordSaturatingAdd to avoid integer overflow. b=541714 r=roc
This commit is contained in:
parent
91827215e2
commit
f282ed34fe
3
layout/generic/crashtests/541714-1.html
Normal file
3
layout/generic/crashtests/541714-1.html
Normal file
@ -0,0 +1,3 @@
|
||||
<html style="overflow: hidden;">
|
||||
<body style="overflow: hidden; direction: rtl; padding: 0 64635% 0 66421238918787500pt; width: 39779329pt;"></body>
|
||||
</html>
|
3
layout/generic/crashtests/541714-2.html
Normal file
3
layout/generic/crashtests/541714-2.html
Normal file
@ -0,0 +1,3 @@
|
||||
<html style="overflow: hidden;">
|
||||
<body style="overflow: hidden; direction: rtl; padding: 64635% 0 66421238918787500pt 0; height: 39779329pt;"></body>
|
||||
</html>
|
@ -294,4 +294,6 @@ load 533379-2.html
|
||||
load 534082-1.html
|
||||
load 541277-1.html
|
||||
load 541277-2.html
|
||||
load 541714-1.html
|
||||
load 541714-2.html
|
||||
load 551635-1.html
|
||||
|
@ -1249,8 +1249,10 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
||||
#endif
|
||||
|
||||
// Compute final width
|
||||
aMetrics.width = borderPadding.left + aReflowState.ComputedWidth() +
|
||||
borderPadding.right;
|
||||
aMetrics.width =
|
||||
NSCoordSaturatingAdd(NSCoordSaturatingAdd(borderPadding.left,
|
||||
aReflowState.ComputedWidth()),
|
||||
borderPadding.right);
|
||||
|
||||
// Return bottom margin information
|
||||
// rbs says he hit this assertion occasionally (see bug 86947), so
|
||||
@ -1321,7 +1323,11 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState,
|
||||
&& computedHeightLeftOver ),
|
||||
"overflow container must not have computedHeightLeftOver");
|
||||
|
||||
aMetrics.height = borderPadding.top + computedHeightLeftOver + borderPadding.bottom;
|
||||
aMetrics.height =
|
||||
NSCoordSaturatingAdd(NSCoordSaturatingAdd(borderPadding.top,
|
||||
computedHeightLeftOver),
|
||||
borderPadding.bottom);
|
||||
|
||||
if (NS_FRAME_IS_NOT_COMPLETE(aState.mReflowStatus)
|
||||
&& aMetrics.height < aReflowState.availableHeight) {
|
||||
// We ran out of height on this page but we're incomplete
|
||||
|
Loading…
Reference in New Issue
Block a user