Fix problem with reading zip64 data descriptor

This commit is contained in:
Timofey Solomko
2017-07-09 13:02:42 +03:00
parent cd6b748adb
commit 98383f2bed
+3 -3
View File
@@ -139,9 +139,9 @@ public class ZipEntry: ContainerEntry {
}
// Now, let's update from CD with values from data descriptor.
crc32 = bitReader.uint32()
let sizeOfSizeField: UInt32 = localHeader!.zip64FieldsArePresent ? 8 : 4
compSize = Int(bitReader.uint32(count: sizeOfSizeField))
uncompSize = Int(bitReader.uint32(count: sizeOfSizeField))
let sizeOfSizeField: UInt64 = localHeader!.zip64FieldsArePresent ? 8 : 4
compSize = Int(bitReader.uint64(count: sizeOfSizeField))
uncompSize = Int(bitReader.uint64(count: sizeOfSizeField))
}
guard compSize == realCompSize && uncompSize == fileBytes.count