From 0eefe2d872dc495d2c25f7bc02fcca9f4a32b712 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Fri, 15 Nov 2024 11:15:14 +0100 Subject: [PATCH] gems/vfs_font: improve glyph bb sanity check Issue #5374 --- repos/gems/include/gems/vfs_font.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/gems/include/gems/vfs_font.h b/repos/gems/include/gems/vfs_font.h index 8a8067530c..3fdf2ab41f 100644 --- a/repos/gems/include/gems/vfs_font.h +++ b/repos/gems/include/gems/vfs_font.h @@ -68,10 +68,10 @@ class Genode::Vfs_font : public Text_painter::Font void with_glyph(Text_painter::Area const bb, auto const &fn) const { /* consider glyph bounds exceeding the font's bounding box */ - uint8_t const clipped_h = uint8_t(_width ? (bb.count() / _width) : 0u); + unsigned const clipped_h = _width ? unsigned(bb.count() / _width) : 0u; fn(Glyph { .width = _width, - .height = min(_height, clipped_h), + .height = min(unsigned(_height), clipped_h), .vpos = _vpos, .advance = _advance(), .values = _values });