mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-01 15:43:36 +03:00
LibGfx: VERIFY() error is finite when splitting bezier curves
If this value somehow becomes nan/inf the painter will keep splitting the path till the process OOMs, a simple crash would be preferable.
This commit is contained in:
parent
1012947a30
commit
9070aaebee
Notes:
sideshowbarker
2024-07-17 00:16:31 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/9070aaebee Pull-request: https://github.com/SerenityOS/serenity/pull/18775
@ -2128,7 +2128,10 @@ static bool can_approximate_bezier_curve(FloatPoint p1, FloatPoint p2, FloatPoin
|
||||
p2x = p2x * p2x;
|
||||
p2y = p2y * p2y;
|
||||
|
||||
return max(p1x, p2x) + max(p1y, p2y) <= tolerance;
|
||||
auto error = max(p1x, p2x) + max(p1y, p2y);
|
||||
VERIFY(isfinite(error));
|
||||
|
||||
return error <= tolerance;
|
||||
}
|
||||
|
||||
// static
|
||||
@ -2202,7 +2205,10 @@ static bool can_approximate_cubic_bezier_curve(FloatPoint p1, FloatPoint p2, Flo
|
||||
bx *= bx;
|
||||
by *= by;
|
||||
|
||||
return max(ax, bx) + max(ay, by) <= tolerance;
|
||||
auto error = max(ax, bx) + max(ay, by);
|
||||
VERIFY(isfinite(error));
|
||||
|
||||
return error <= tolerance;
|
||||
}
|
||||
|
||||
// static
|
||||
|
Loading…
Reference in New Issue
Block a user