LibWeb: Ensure CanvasPath::arc() nonfinite radius argument is ignored

This commit is contained in:
Tim Ledbetter 2025-10-20 10:37:59 +01:00 committed by Sam Atkins
commit 08641c9e15
Notes: github-actions[bot] 2025-10-20 11:13:21 +00:00
3 changed files with 84 additions and 1 deletions

View file

@ -95,7 +95,7 @@ void CanvasPath::bezier_curve_to(double cp1x, double cp1y, double cp2x, double c
WebIDL::ExceptionOr<void> CanvasPath::arc(float x, float y, float radius, float start_angle, float end_angle, bool counter_clockwise)
{
if (radius < 0)
if (radius < 0 && isfinite(radius))
return WebIDL::IndexSizeError::create(m_self->realm(), Utf16String::formatted("The radius provided ({}) is negative.", radius));
return ellipse(x, y, radius, radius, 0, start_angle, end_angle, counter_clockwise);
}