From 3cc6ffd4a6d3e48724953c0fe3cc7704c011301e Mon Sep 17 00:00:00 2001 From: Tobias Christiansen Date: Fri, 17 Sep 2021 20:41:09 +0200 Subject: [PATCH] LibGfx: Don't crash on request to draw impossible circle segment The previous VERIFY_NOT_REACHED() could be reached when there were equal coodinates. This could be the case for a small radius which lead to rounding making the two coordinates equal. --- Userland/Libraries/LibWeb/Layout/Box.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/Box.cpp b/Userland/Libraries/LibWeb/Layout/Box.cpp index f371e4da25..d419a9f73c 100644 --- a/Userland/Libraries/LibWeb/Layout/Box.cpp +++ b/Userland/Libraries/LibWeb/Layout/Box.cpp @@ -131,8 +131,8 @@ void Box::paint_border(PaintContext& context) circle_position.set_y(to.y()); center.set_x(radius); } else { - // How did you get here? - VERIFY_NOT_REACHED(); + // You are lying about your intentions of drawing a quarter circle, your coordinates are (partly) the same! + return; } Gfx::IntRect circle_rect = {