From 6a326344401b88f04226b0dff899701d78b45db8 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 4 Sep 2023 18:38:00 +0200 Subject: [PATCH] LibGfx: Don't crash on Typeface::get_font() with size 0 If someone wants a zero-sized font, we can just give it to them instead of making a fuss. --- Userland/Libraries/LibGfx/Font/Typeface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/Font/Typeface.cpp b/Userland/Libraries/LibGfx/Font/Typeface.cpp index e8522f6559..922749bb82 100644 --- a/Userland/Libraries/LibGfx/Font/Typeface.cpp +++ b/Userland/Libraries/LibGfx/Font/Typeface.cpp @@ -61,7 +61,7 @@ void Typeface::set_vector_font(RefPtr font) RefPtr Typeface::get_font(float point_size, Font::AllowInexactSizeMatch allow_inexact_size_match) const { - VERIFY(point_size > 0); + VERIFY(point_size >= 0); if (m_vector_font) return adopt_ref(*new Gfx::ScaledFont(*m_vector_font, point_size, point_size));