Skip to content

Commit

Permalink
Fix reading disk number start on zip64 files in minizip.
Browse files Browse the repository at this point in the history
  • Loading branch information
madler committed Jul 30, 2023
1 parent 7b28ecc commit e0bd0ad
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions contrib/minizip/unzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,8 +988,6 @@ local int unz64local_GetCurrentFileInfoInternal(unzFile file,
/* ZIP64 extra fields */
if (headerId == 0x0001)
{
uLong uL;

if(file_info.uncompressed_size == MAXU32)
{
if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK)
Expand All @@ -1009,10 +1007,10 @@ local int unz64local_GetCurrentFileInfoInternal(unzFile file,
err=UNZ_ERRNO;
}

if(file_info.disk_num_start == MAXU32)
if(file_info.disk_num_start == 0xffff)
{
/* Disk Start Number */
if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK)
if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK)
err=UNZ_ERRNO;
}

Expand Down

0 comments on commit e0bd0ad

Please sign in to comment.