1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
This commit is contained in:
Ronan 2025-12-27 19:47:46 +00:00 committed by GitHub
commit 35f87f2483
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -63,6 +63,28 @@ struct ZipFile::ZipEntryHolder
entry.isSymbolicLink = (fileType == 0xA);
entry.filename = String::fromUTF8 (buffer + 46, fileNameLen);
auto const extraFieldLength = ByteOrder::littleEndianShort(buffer + 30);
if (extraFieldLength != 0)
{
auto extraFieldOffset = 0;
auto* extraHeaderPtr = buffer + 46 + fileNameLen;
auto* extraSectionPtr = extraHeaderPtr;
while (extraFieldOffset < extraFieldLength) {
auto extraHeaderTag = ByteOrder::littleEndianShort(extraSectionPtr);
auto extraFieldSectionLength = ByteOrder::littleEndianShort(extraSectionPtr + 2);
if (extraHeaderTag == 0x0001) // Zip64 Tag
{
entry.uncompressedSize = (int64)ByteOrder::littleEndianInt64(extraSectionPtr + 4);
if (extraFieldSectionLength > 8)
compressedSize = (int64)ByteOrder::littleEndianInt64(extraHeaderPtr + 12);
if (extraFieldSectionLength > 16)
streamOffset = (int64)ByteOrder::littleEndianInt64(extraHeaderPtr + 20);
}
extraFieldOffset += extraFieldSectionLength + 4;
extraSectionPtr = extraHeaderPtr + extraFieldOffset;
}
}
}
static Time parseFileTime (uint32 time, uint32 date) noexcept