Skip to content

Commit

Permalink
fix(inflate): byte boundary aligning underflow
Browse files Browse the repository at this point in the history
  • Loading branch information
CompeyDev committed Jan 7, 2025
1 parent 77d1a75 commit 6daf378
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/inflate.luau
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,10 @@ end
--- Processes an uncompressed block
local function inflateUncompressedBlock(d: Data)
-- Align to byte boundary
while d.bitcount > 8 do
d.sourceIndex -= 1
d.bitcount -= 8
end
local bytesToMove = d.bitcount // 8
d.sourceIndex -= bytesToMove
d.bitcount = 0
d.tag = 0

-- Read block length and its complement
local length = buffer.readu8(d.source, d.sourceIndex + 1)
Expand Down

0 comments on commit 6daf378

Please sign in to comment.