mirror of
https://github.com/0x5eal/luau-unzip.git
synced 2025-04-08 00:01:00 +01:00
fix(inflate): byte boundary aligning underflow
This commit is contained in:
parent
77d1a75996
commit
6daf378492
1 changed files with 4 additions and 4 deletions
|
@ -313,10 +313,10 @@ end
|
||||||
--- Processes an uncompressed block
|
--- Processes an uncompressed block
|
||||||
local function inflateUncompressedBlock(d: Data)
|
local function inflateUncompressedBlock(d: Data)
|
||||||
-- Align to byte boundary
|
-- Align to byte boundary
|
||||||
while d.bitcount > 8 do
|
local bytesToMove = d.bitcount // 8
|
||||||
d.sourceIndex -= 1
|
d.sourceIndex -= bytesToMove
|
||||||
d.bitcount -= 8
|
d.bitcount = 0
|
||||||
end
|
d.tag = 0
|
||||||
|
|
||||||
-- Read block length and its complement
|
-- Read block length and its complement
|
||||||
local length = buffer.readu8(d.source, d.sourceIndex + 1)
|
local length = buffer.readu8(d.source, d.sourceIndex + 1)
|
||||||
|
|
Loading…
Add table
Reference in a new issue