Index: third_party/zlib/contrib/minizip/unzip.c |
diff --git a/third_party/zlib/contrib/minizip/unzip.c b/third_party/zlib/contrib/minizip/unzip.c |
index af59b8029443c28da6f5fd6df6c26fb817ede519..ec58883c9c99159f3e9aef721c37ee79886cdd19 100644 |
--- a/third_party/zlib/contrib/minizip/unzip.c |
+++ b/third_party/zlib/contrib/minizip/unzip.c |
@@ -188,7 +188,7 @@ typedef struct |
# ifndef NOUNCRYPT |
unsigned long keys[3]; /* keys defining the pseudo-random sequence */ |
- const unsigned long* pcrc_32_tab; |
+ const z_crc_t* pcrc_32_tab; |
# endif |
} unz64_s; |
@@ -801,9 +801,9 @@ extern unzFile ZEXPORT unzOpen64 (const void *path) |
} |
/* |
- Close a ZipFile opened with unzipOpen. |
- If there is files inside the .Zip opened with unzipOpenCurrentFile (see later), |
- these files MUST be closed with unzipCloseCurrentFile before call unzipClose. |
+ Close a ZipFile opened with unzOpen. |
+ If there is files inside the .Zip opened with unzOpenCurrentFile (see later), |
+ these files MUST be closed with unzCloseCurrentFile before call unzClose. |
return UNZ_OK if there is no problem. */ |
extern int ZEXPORT unzClose (unzFile file) |
{ |
@@ -1145,7 +1145,7 @@ extern int ZEXPORT unzGetCurrentFileInfo (unzFile file, |
szFileName,fileNameBufferSize, |
extraField,extraFieldBufferSize, |
szComment,commentBufferSize); |
- if (err==UNZ_OK) |
+ if ((err==UNZ_OK) && (pfile_info != NULL)) |
{ |
pfile_info->version = file_info64.version; |
pfile_info->version_needed = file_info64.version_needed; |
@@ -1223,7 +1223,7 @@ extern int ZEXPORT unzGoToNextFile (unzFile file) |
/* |
Try locate the file szFileName in the zipfile. |
- For the iCaseSensitivity signification, see unzipStringFileNameCompare |
+ For the iCaseSensitivity signification, see unzStringFileNameCompare |
return value : |
UNZ_OK if the file is found. It becomes the current file. |
@@ -1696,7 +1696,7 @@ extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) |
return UNZ_PARAMERROR; |
- if ((pfile_in_zip_read_info->read_buffer == NULL)) |
+ if (pfile_in_zip_read_info->read_buffer == NULL) |
return UNZ_END_OF_LIST_OF_FILE; |
if (len==0) |
return 0; |
@@ -1705,6 +1705,11 @@ extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) |
pfile_in_zip_read_info->stream.avail_out = (uInt)len; |
+ if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && |
+ (!(pfile_in_zip_read_info->raw))) |
+ pfile_in_zip_read_info->stream.avail_out = |
+ (uInt)pfile_in_zip_read_info->rest_read_uncompressed; |
+ |
if ((len>pfile_in_zip_read_info->rest_read_compressed+ |
pfile_in_zip_read_info->stream.avail_in) && |
(pfile_in_zip_read_info->raw)) |
@@ -1993,7 +1998,7 @@ extern int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) |
} |
/* |
- Close the file in zip opened with unzipOpenCurrentFile |
+ Close the file in zip opened with unzOpenCurrentFile |
Return UNZ_CRCERROR if all the file was read but the CRC is not good |
*/ |
extern int ZEXPORT unzCloseCurrentFile (unzFile file) |