From 416dde7b19b25a98643d91975d17b535623cc8b0 Mon Sep 17 00:00:00 2001 From: Mirek Fidler Date: Thu, 29 Jan 2026 12:00:44 +0100 Subject: [PATCH] Draw: Sanitized glyph rendering with invalid size --- uppsrc/Draw/Draw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uppsrc/Draw/Draw.cpp b/uppsrc/Draw/Draw.cpp index 4eaf9f7e0..210699c82 100644 --- a/uppsrc/Draw/Draw.cpp +++ b/uppsrc/Draw/Draw.cpp @@ -441,7 +441,7 @@ bool HasPainter() Image RenderGlyphByPainter(Point at, int angle, int chr, Font fnt, Color color, Size sz) { - return sRG ? (*sRG)(at, angle, chr, fnt, color, sz) : Image(); + return sRG && sz.cx > 0 && sz.cy > 0 ? (*sRG)(at, angle, chr, fnt, color, sz) : Image(); } void PaintImageBuffer(ImageBuffer& ib, const Painting& p, Size sz, Point pos, int mode)