mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-19 15:04:50 +02:00
Ensure bounds in add_line()
This commit is contained in:
@@ -73,7 +73,7 @@ def resize_fonts(new_sz):
|
|||||||
|
|
||||||
def add_line(buf, cell_width, position, thickness, cell_height):
|
def add_line(buf, cell_width, position, thickness, cell_height):
|
||||||
y = position - thickness // 2
|
y = position - thickness // 2
|
||||||
while thickness:
|
while thickness > 0 and y > -1 and y < cell_height - 1:
|
||||||
thickness -= 1
|
thickness -= 1
|
||||||
ctypes.memset(ctypes.addressof(buf) + (cell_width * y), 255, cell_width)
|
ctypes.memset(ctypes.addressof(buf) + (cell_width * y), 255, cell_width)
|
||||||
y += 1
|
y += 1
|
||||||
|
|||||||
Reference in New Issue
Block a user