forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating miniz library from version 2.0.8 -> 2.1.0 (pytorch#79636)
Summary: This PR updates the miniz library from version 2.0.8 to 2.1.0. Pull Request resolved: pytorch#79636 Approved by: https://github.com/albanD
- Loading branch information
1 parent
28a7ee8
commit 7ea723b
Showing
19 changed files
with
206 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
## Changelog | ||
|
||
### 2.1.0 | ||
|
||
- More instances of memcpy instead of cast and use memcpy per default | ||
- Remove inline for c90 support | ||
- New function to read files via callback functions when adding them | ||
- Fix out of bounds read while reading Zip64 extended information | ||
- guard memcpy when n == 0 because buffer may be NULL | ||
- Implement inflateReset() function | ||
- Move comp/decomp alloc/free prototypes under guarding #ifndef MZ_NO_MALLOC | ||
- Fix large file support under Windows | ||
- Don't warn if _LARGEFILE64_SOURCE is not defined to 1 | ||
- Fixes for MSVC warnings | ||
- Remove check that path of file added to archive contains ':' or '\' | ||
- Add !defined check on MINIZ_USE_ALIGNED_LOADS_AND_STORES | ||
|
||
### 2.0.8 | ||
|
||
- Remove unimplemented functions (mz_zip_locate_file and mz_zip_locate_file_v2) | ||
- Add license, changelog, readme and example files to release zip | ||
- Fix heap overflow to user buffer in tinfl_status tinfl_decompress | ||
- Fix corrupt archive if uncompressed file smaller than 4 byte and file is added by mz_zip_writer_add_mem* | ||
- Fix corrupt archive if uncompressed file smaller than 4 byte and the file is added by mz_zip_writer_add_mem* | ||
|
||
### 2.0.7 | ||
|
||
- Removed need in C++ compiler in cmake build | ||
- Fixed loads of uninitialized value errors found with Valgrind by memsetting m_dict to 0 in tdefl_init. | ||
- Fixed a lot of uninitialized value errors found with Valgrind by memsetting m_dict to 0 in tdefl_init | ||
- Fix resource leak in mz_zip_reader_init_file_v2 | ||
- Fix assert with mz_zip_writer_add_mem* w/MZ_DEFAULT_COMPRESSION | ||
- cmake build: install library and headers | ||
|
@@ -19,7 +34,7 @@ | |
### 2.0.6 | ||
|
||
- Improve MZ_ZIP_FLAG_WRITE_ZIP64 documentation | ||
- Remove check for cur_archive_file_ofs > UINT_MAX, because cur_archive_file_ofs is not used after this point | ||
- Remove check for cur_archive_file_ofs > UINT_MAX because cur_archive_file_ofs is not used after this point | ||
- Add cmake debug configuration | ||
- Fix PNG height when creating png files | ||
- Add "iterative" file extraction method based on mz_zip_reader_extract_to_callback. | ||
|
@@ -49,11 +64,12 @@ | |
|
||
### 2.0.0 beta | ||
|
||
- Matthew Sitton merged to vogl ZIP64 changes. Miniz is now licensed as MIT since the vogl code base is MIT licensed | ||
- Matthew Sitton merged miniz 1.x to Rich Geldreich's vogl ZIP64 changes. Miniz is now licensed as MIT since the vogl code base is MIT licensed | ||
- Miniz is now split into several files | ||
- Miniz does now not seek backwards when creating ZIP files. That is the ZIP files can be streamed | ||
- Miniz automatically switches to the ZIP64 format the created ZIP files goes over ZIP file limits | ||
- Miniz automatically switches to the ZIP64 format when the created ZIP files goes over ZIP file limits | ||
- Similar to [SQLite](https://www.sqlite.org/amalgamation.html) the Miniz source code is amalgamated into one miniz.c/miniz.h pair in a build step (amalgamate.sh). Please use miniz.c/miniz.h in your projects | ||
- Miniz 2 is only source back-compatible with miniz 1.x. It breaks binary compatibility because structures changed | ||
|
||
### v1.16 BETA Oct 19, 2013 | ||
|
||
|
@@ -66,7 +82,7 @@ The inflator now has a new failure status TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRE | |
- The inflator coroutine func. is subtle and complex so I'm being cautious about this release. I would greatly appreciate any help with testing or any feedback. | ||
I feel good about these changes, and they've been through several hours of automated testing, but they will probably not fix anything for the majority of prev. users so I'm | ||
going to mark this release as beta for a few weeks and continue testing it at work/home on various things. | ||
- The inflator in raw (non-zlib) mode is now usable on gzip or similar data streams that have a bunch of bytes following the raw deflate data (problem discovered by rustyzip author williamw520). | ||
- The inflator in raw (non-zlib) mode is now usable on gzip or similiar data streams that have a bunch of bytes following the raw deflate data (problem discovered by rustyzip author williamw520). | ||
This version should *never* read beyond the last byte of the raw deflate data independent of how many bytes you pass into the input buffer. This issue was caused by the various Huffman bitbuffer lookahead optimizations, and | ||
would not be an issue if the caller knew and enforced the precise size of the raw compressed data *or* if the compressed data was in zlib format (i.e. always followed by the byte aligned zlib adler32). | ||
So in other words, you can now call the inflator on deflate streams that are followed by arbitrary amounts of data and it's guaranteed that decompression will stop exactly on the last byte. | ||
|
@@ -87,7 +103,7 @@ Merged over a few very minor bug fixes that I fixed in the zip64 branch. This is | |
Interim bugfix release while I work on the next major release with zip64 and streaming compression/decompression support. Fixed the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY bug (thanks [email protected]), which could cause the locate files func to not find files when this flag was specified. Also fixed a bug in mz_zip_reader_extract_to_mem_no_alloc() with user provided read buffers (thanks kymoon). I also merged lots of compiler fixes from various github repo branches and Google Code issue reports. I finally added cmake support (only tested under for Linux so far), compiled and tested with clang v3.3 and gcc 4.6 (under Linux), added defl_write_image_to_png_file_in_memory_ex() (supports Y flipping for OpenGL use, real-time compression), added a new PNG example (example6.c - Mandelbrot), and I added 64-bit file I/O support (stat64(), etc.) for glibc. | ||
|
||
- Critical fix for the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY bug (thanks [email protected]) which could cause locate files to not find files. This bug | ||
would only have occurred in earlier versions if you explicitly used this flag, OR if you used mz_zip_extract_archive_file_to_heap() or mz_zip_add_mem_to_archive_file_in_place() | ||
would only have occured in earlier versions if you explicitly used this flag, OR if you used mz_zip_extract_archive_file_to_heap() or mz_zip_add_mem_to_archive_file_in_place() | ||
(which used this flag). If you can't switch to v1.15 but want to fix this bug, just remove the uses of this flag from both helper funcs (and of course don't use the flag). | ||
- Bugfix in mz_zip_reader_extract_to_mem_no_alloc() from kymoon when pUser_read_buf is not NULL and compressed size is > uncompressed size | ||
- Fixing mz_zip_reader_extract_*() funcs so they don't try to extract compressed data from directory entries, to account for weird zipfiles which contain zero-size compressed data on dir entries. | ||
|
@@ -104,7 +120,7 @@ Interim bugfix release while I work on the next major release with zip64 and str | |
- Retested this build under Windows (VS 2010, including static analysis), tcc 0.9.26, gcc v4.6 and clang v3.3. | ||
- Added example6.c, which dumps an image of the mandelbrot set to a PNG file. | ||
- Modified example2 to help test the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY flag more. | ||
- In r3: Bugfix to mz_zip_writer_add_file() found during merge: Fix possible src file fclose() leak if alignment bytes+local header file write failed | ||
- In r3: Bugfix to mz_zip_writer_add_file() found during merge: Fix possible src file fclose() leak if alignment bytes+local header file write faiiled | ||
- In r4: Minor bugfix to mz_zip_writer_add_from_zip_reader(): Was pushing the wrong central dir header offset, appears harmless in this release, but it became a problem in the zip64 branch | ||
|
||
### v1.14 - May 20, 2012 | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
// Public domain, May 15 2011, Rich Geldreich, [email protected]. See "unlicense" statement at the end of tinfl.c. | ||
#include <stdio.h> | ||
#include "miniz.h" | ||
#include "miniz_zip.h" | ||
typedef unsigned char uint8; | ||
typedef unsigned short uint16; | ||
typedef unsigned int uint; | ||
|
@@ -18,26 +17,6 @@ static const char *s_pStr = "Good morning Dr. Chandra. This is Hal. I am ready f | |
|
||
int main(int argc, char *argv[]) | ||
{ | ||
{ | ||
mz_zip_archive zip_archive; | ||
memset(&zip_archive, 0, sizeof(zip_archive)); // mz_zip_archive contains a bunch of pointers. set all to nullptr | ||
mz_bool status = mz_zip_writer_init(&zip_archive, 0); | ||
if (!status) | ||
return; | ||
|
||
status = mz_zip_writer_add_file(&zip_archive, "Images.zip", "Images/title.png", NULL, 0, MZ_DEFAULT_COMPRESSION); | ||
if (!status) | ||
return; | ||
|
||
status = mz_zip_writer_finalize_archive(&zip_archive); | ||
if (!status) | ||
return; | ||
|
||
status = mz_zip_writer_end(&zip_archive); | ||
if (!status) | ||
return; | ||
} | ||
|
||
uint step = 0; | ||
int cmp_status; | ||
uLong src_len = (uLong)strlen(s_pStr); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.