mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
terminal: fix crashing when terminal size is < 0
Just skip drawing when width or height is less than zero. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
This commit is contained in:
parent
86653ed273
commit
5fd89d255b
1 changed files with 4 additions and 0 deletions
|
|
@ -838,6 +838,10 @@ terminal_draw(struct terminal *terminal)
|
||||||
(int32_t) terminal->extents.max_x_advance;
|
(int32_t) terminal->extents.max_x_advance;
|
||||||
height = (rectangle.height - 2 * terminal->margin) /
|
height = (rectangle.height - 2 * terminal->margin) /
|
||||||
(int32_t) terminal->extents.height;
|
(int32_t) terminal->extents.height;
|
||||||
|
|
||||||
|
if (width < 0 || height < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
terminal_resize(terminal, width, height);
|
terminal_resize(terminal, width, height);
|
||||||
|
|
||||||
window_draw(terminal->window);
|
window_draw(terminal->window);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue