summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2021-01-29 20:35:57 -0600
committercheapie <no-email-for-you@example.com>2021-01-29 20:35:57 -0600
commit5c2cb60815157dd7d739631ab75451b5fc458df6 (patch)
tree4e79f6f046ff728f196ac7f8903b0b1a2591cdaf
parente15ca1445c36a55b9031b8f88f2ab07d7c15df84 (diff)
downloaddigistuff-5c2cb60815157dd7d739631ab75451b5fc458df6.tar
digistuff-5c2cb60815157dd7d739631ab75451b5fc458df6.tar.gz
digistuff-5c2cb60815157dd7d739631ab75451b5fc458df6.tar.bz2
digistuff-5c2cb60815157dd7d739631ab75451b5fc458df6.tar.xz
digistuff-5c2cb60815157dd7d739631ab75451b5fc458df6.zip
Fix bounds checking in load command
-rw-r--r--gpu.lua2
1 files changed, 1 insertions, 1 deletions
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