Skip to content

Commit

Permalink
sway_text_node: Enforce a default max_width
Browse files Browse the repository at this point in the history
Avoid creating absurd buffers before max_width is set by enforcing a
default maximum of 3840 pixels.
  • Loading branch information
kennylevinsen committed Feb 25, 2025
1 parent 92dcb97 commit 8023b06
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sway/sway_text_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8023b06

Please sign in to comment.