Check for width/height 0, based on change from Uzair Aftab.

This commit is contained in:
nicm
2026-07-06 12:08:52 +00:00
parent d565fd3b54
commit 85e3ca5ae2

View File

@@ -834,6 +834,11 @@ mode_tree_draw(struct mode_tree_data *mtd)
if (mtd->line_size == 0)
return;
w = mtd->width;
h = mtd->height;
if (w == 0 || h == 0)
return;
memcpy(&gc0, &grid_default_cell, sizeof gc0);
memcpy(&gc, &grid_default_cell, sizeof gc);
style_apply(&gc, oo, "tree-mode-selection-style", NULL);
@@ -843,9 +848,6 @@ mode_tree_draw(struct mode_tree_data *mtd)
dfg = gc.fg;
dfg0 = gc0.fg;
w = mtd->width;
h = mtd->height;
screen_write_start(&ctx, s);
screen_write_clearscreen(&ctx, 8);
ft = format_create_defaults(NULL, NULL, NULL, NULL, wp);