@@ -966,11 +966,35 @@ internal void ProcessExtraData(bool localHeader)
966966 throw new ZipException ( "Extra data extended Zip64 information length is invalid" ) ;
967967 }
968968
969- if ( localHeader || ( size == uint . MaxValue ) ) {
969+ // (localHeader ||) was deleted, because actually there is no specific difference with reading sizes between local header & central directory
970+ // https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
971+ // ...
972+ // 4.4 Explanation of fields
973+ // ...
974+ // 4.4.8 compressed size: (4 bytes)
975+ // 4.4.9 uncompressed size: (4 bytes)
976+ //
977+ // The size of the file compressed (4.4.8) and uncompressed,
978+ // (4.4.9) respectively. When a decryption header is present it
979+ // will be placed in front of the file data and the value of the
980+ // compressed file size will include the bytes of the decryption
981+ // header. If bit 3 of the general purpose bit flag is set,
982+ // these fields are set to zero in the local header and the
983+ // correct values are put in the data descriptor and
984+ // in the central directory. If an archive is in ZIP64 format
985+ // and the value in this field is 0xFFFFFFFF, the size will be
986+ // in the corresponding 8 byte ZIP64 extended information
987+ // extra field. When encrypting the central directory, if the
988+ // local header is not in ZIP64 format and general purpose bit
989+ // flag 13 is set indicating masking, the value stored for the
990+ // uncompressed size in the Local Header will be zero.
991+ //
992+ // Othewise there is problem with minizip implementation
993+ if ( size == uint . MaxValue ) {
970994 size = ( ulong ) extraData . ReadLong ( ) ;
971995 }
972996
973- if ( localHeader || ( compressedSize == uint . MaxValue ) ) {
997+ if ( compressedSize == uint . MaxValue ) {
974998 compressedSize = ( ulong ) extraData . ReadLong ( ) ;
975999 }
9761000
0 commit comments