From 6dafeb78209254ad4d93781f1bb405d08a374b2e Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Wed, 6 Mar 2024 19:23:47 -0600 Subject: [PATCH] render: check bounds when setting `skipped` A double-wide character in the last cell can force this to go OOB. Signed-off-by: Tim Culverhouse --- src/vaxis.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vaxis.zig b/src/vaxis.zig index 48fcf26..8453f25 100644 --- a/src/vaxis.zig +++ b/src/vaxis.zig @@ -300,6 +300,7 @@ pub fn Vaxis(comptime T: type) type { std.debug.assert(w > 0); var j = i + 1; while (j < i + w) : (j += 1) { + if (j >= self.screen_last.buf.len) break; self.screen_last.buf[j].skipped = true; } col += w;