mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 07:39:31 +02:00
* handle streams with bit 3 better, closes #40369
This commit is contained in:
parent
dcb91d0b52
commit
4561d8982f
@ -2329,6 +2329,15 @@ Begin
|
||||
With LocalHdr do
|
||||
begin
|
||||
Item.FBitFlags:=Bit_Flag;
|
||||
// If bit 3 is set in the BitFlags, file size and CRC should be read from
|
||||
// the DataDescriptor record. For simplicity, however, we copy them from
|
||||
// the same fields of the zipfile entry.
|
||||
if Item.FBitFlags and $0008 <> 0 then
|
||||
begin
|
||||
Uncompressed_Size := Item.Size;
|
||||
Compressed_Size := Item.CompressedSize;
|
||||
CRC32 := Item.CRC32;
|
||||
end;
|
||||
SetLength(S,Filename_Length);
|
||||
FZipStream.ReadBuffer(S[1],Filename_Length);
|
||||
if Bit_Flag and EFS_LANGUAGE_ENCODING_FLAG <> 0 then
|
||||
@ -2597,6 +2606,7 @@ Begin
|
||||
// Header position will be corrected later with zip64 version, if needed..
|
||||
NewNode.HdrPos := Local_Header_Offset;
|
||||
NewNode.FBitFlags:=Bit_Flag;
|
||||
NewNode.FCompressMethod := Compress_Method;
|
||||
SetLength(S,Filename_Length);
|
||||
FZipStream.ReadBuffer(S[1],Filename_Length);
|
||||
if Bit_Flag and EFS_LANGUAGE_ENCODING_FLAG <> 0 then
|
||||
|
Loading…
Reference in New Issue
Block a user