From 2bbad26dd1afd145b94f421e6fb3da8ae4ffefcb Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 7 Sep 2022 16:47:42 -0700 Subject: [PATCH] sixel: skip setting pixel if x-coord is out of range speculative fix for https://github.com/wez/wezterm/issues/2500 which doesn't repro for me(!) --- term/src/terminalstate/sixel.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/term/src/terminalstate/sixel.rs b/term/src/terminalstate/sixel.rs index ae275a478..e2e14268a 100644 --- a/term/src/terminalstate/sixel.rs +++ b/term/src/terminalstate/sixel.rs @@ -39,6 +39,9 @@ impl TerminalState { let mut foreground_color = RgbColor::new_8bpc(0, 0xff, 0); let mut emit_sixel = |d: &u8, foreground_color: &RgbColor, x: u32, y: u32| { + if x >= width { + return; + } let (red, green, blue) = foreground_color.to_tuple_rgb8(); for bitno in 0..6 { if y + bitno >= height {