From 8023b06d39b797f74543bcc4add54bc141e77fc6 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Tue, 25 Feb 2025 10:58:06 +0100 Subject: [PATCH] sway_text_node: Enforce a default max_width Avoid creating absurd buffers before max_width is set by enforcing a default maximum of 3840 pixels. --- sway/sway_text_node.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sway/sway_text_node.c b/sway/sway_text_node.c index b5d35f2793..fcd1163a8e 100644 --- a/sway/sway_text_node.c +++ b/sway/sway_text_node.c @@ -60,6 +60,8 @@ static int get_text_width(struct sway_text_node *props) { int width = props->width; if (props->max_width >= 0) { width = MIN(width, props->max_width); + } else { + width = MIN(width, 3840); } return MAX(width, 0); }