mirror of
https://github.com/0x5eal/luau-unzip.git
synced 2025-04-10 17:20:53 +01:00
fix: use proper byte count corresponding to 64 KB
This commit is contained in:
parent
a5bb7166ad
commit
bd30a000ef
1 changed files with 2 additions and 1 deletions
|
@ -453,7 +453,7 @@ function ZipReader.findEocdPosition(self: ZipReader): number
|
||||||
local bufSize = buffer.len(self.data)
|
local bufSize = buffer.len(self.data)
|
||||||
|
|
||||||
-- Start from the minimum possible position of EoCD (22 bytes from end)
|
-- Start from the minimum possible position of EoCD (22 bytes from end)
|
||||||
local position = math.max(0, bufSize - (22 + 65578) --[[ max comment size: 64 KB ]])
|
local position = math.max(0, bufSize - (22 + 65536) --[[ max comment size: 64 KB ]])
|
||||||
local searchBuf = buffer.create(BUFFER_SIZE)
|
local searchBuf = buffer.create(BUFFER_SIZE)
|
||||||
|
|
||||||
while position < bufSize do
|
while position < bufSize do
|
||||||
|
@ -538,6 +538,7 @@ function ZipReader.parseEocdRecord(self: ZipReader, pos: number): EocdRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
local commentLength = buffer.readu16(self.data, pos + 20)
|
local commentLength = buffer.readu16(self.data, pos + 20)
|
||||||
|
print("comment len:", commentLength)
|
||||||
return {
|
return {
|
||||||
diskNumber = buffer.readu16(self.data, pos + 4),
|
diskNumber = buffer.readu16(self.data, pos + 4),
|
||||||
diskWithCD = buffer.readu16(self.data, pos + 6),
|
diskWithCD = buffer.readu16(self.data, pos + 6),
|
||||||
|
|
Loading…
Add table
Reference in a new issue