From da0309545e6fbe091920f2c8b979d179c3aede26 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 13 Dec 2017 13:46:28 +0530 Subject: [PATCH] Ensure bounds in add_line() --- kitty/fonts/render.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/fonts/render.py b/kitty/fonts/render.py index 774ec6d2f..0ee85254f 100644 --- a/kitty/fonts/render.py +++ b/kitty/fonts/render.py @@ -73,7 +73,7 @@ def resize_fonts(new_sz): def add_line(buf, cell_width, position, thickness, cell_height): y = position - thickness // 2 - while thickness: + while thickness > 0 and y > -1 and y < cell_height - 1: thickness -= 1 ctypes.memset(ctypes.addressof(buf) + (cell_width * y), 255, cell_width) y += 1