From 5dbf90412f6c03510b845bce2edff358773a1c5e Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 28 Jan 2018 23:33:31 -0800 Subject: [PATCH] bounds check should be on the actual number of cols Don't trust that a given Line has exactly phys_cols columns. --- src/xwin.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xwin.rs b/src/xwin.rs index 194bc415b..10d9e8717 100644 --- a/src/xwin.rs +++ b/src/xwin.rs @@ -217,7 +217,7 @@ impl<'a> TerminalWindow<'a> { // We infer this from the X position rather than enumerate the // glyph_info iterator because glyphs may advance by multiple cells. let cell_idx = x as usize / cell_width; - if cell_idx > phys_cols { + if cell_idx >= line.cells.len() { // Don't bother rendering outside the viewable area break; }