From 91dd9d3dfa261a05989b35c15d3d005576a9932b Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 2 Jan 2024 17:02:40 +0900 Subject: [PATCH] [console] Clamp min charbuf size to 1x1 Prevents a segfault when the window is ultra-tiny (eg, 80x45 pixels) --- libs/console/client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/console/client.c b/libs/console/client.c index 4129e22ac..a46d1376a 100644 --- a/libs/console/client.c +++ b/libs/console/client.c @@ -677,6 +677,8 @@ resize_console_text (view_t view, view_pos_t len) int width = len.x / 8; int height = len.y / 8; + width = max (width, 1); + height = max (height, 1); if (console_buffer->width != width || console_buffer->height != height) { con_linewidth = width; Draw_DestroyBuffer (console_buffer);