From 5c2cb60815157dd7d739631ab75451b5fc458df6 Mon Sep 17 00:00:00 2001 From: cheapie Date: Fri, 29 Jan 2021 20:35:57 -0600 Subject: Fix bounds checking in load command --- gpu.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpu.lua b/gpu.lua index cb8bc1f..2775ddc 100644 --- a/gpu.lua +++ b/gpu.lua @@ -309,7 +309,7 @@ local function runcommand(pos,meta,command) if #command.data[1] < 1 then return end local ysize = #command.data local xsize = #command.data[1] - if xstart+xsize > buffer.xsize or ystart+ysize > buffer.ysize then return end + if xstart+xsize-1 > buffer.xsize or ystart+ysize-1 > buffer.ysize then return end for y=1,ysize,1 do if type(command.data[y]) == "table" then for x=1,xsize,1 do -- cgit v1.2.3