diff options
| author | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2025-09-12 15:44:14 +0300 |
|---|---|---|
| committer | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2025-09-12 15:44:27 +0300 |
| commit | 2efdd2583da9575242091bb53c57a311c3eacbc6 (patch) | |
| tree | 17a87333cb30382c8dd95eb8a155eaca3addc50b /kms++util/src/drawing.cpp | |
| parent | ce748d0b1e9f78b29cc2029f9446cd242af5fa3c (diff) | |
kms++util: Fix drawing outside fb boundaries
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Diffstat (limited to 'kms++util/src/drawing.cpp')
| -rw-r--r-- | kms++util/src/drawing.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kms++util/src/drawing.cpp b/kms++util/src/drawing.cpp index 862638b..7e3ca97 100644 --- a/kms++util/src/drawing.cpp +++ b/kms++util/src/drawing.cpp @@ -533,6 +533,10 @@ static bool get_char_pixel(char c, uint32_t x, uint32_t y) static void draw_char(IFramebuffer& buf, uint32_t xpos, uint32_t ypos, char c, RGB color) { + // Skip characters that are not fully drawable + if (xpos + 8 > buf.width() || ypos + 8 > buf.height()) + return; + unsigned x, y; YUV yuvcolor = color.yuv(); |
