1## Changelog 2 3### 2.1.0 4 5 - More instances of memcpy instead of cast and use memcpy per default 6 - Remove inline for c90 support 7 - New function to read files via callback functions when adding them 8 - Fix out of bounds read while reading Zip64 extended information 9 - guard memcpy when n == 0 because buffer may be NULL 10 - Implement inflateReset() function 11 - Move comp/decomp alloc/free prototypes under guarding #ifndef MZ_NO_MALLOC 12 - Fix large file support under Windows 13 - Don't warn if _LARGEFILE64_SOURCE is not defined to 1 14 - Fixes for MSVC warnings 15 - Remove check that path of file added to archive contains ':' or '\' 16 - Add !defined check on MINIZ_USE_ALIGNED_LOADS_AND_STORES 17 18### 2.0.8 19 20 - Remove unimplemented functions (mz_zip_locate_file and mz_zip_locate_file_v2) 21 - Add license, changelog, readme and example files to release zip 22 - Fix heap overflow to user buffer in tinfl_status tinfl_decompress 23 - Fix corrupt archive if uncompressed file smaller than 4 byte and the file is added by mz_zip_writer_add_mem* 24 25### 2.0.7 26 27 - Removed need in C++ compiler in cmake build 28 - Fixed a lot of uninitialized value errors found with Valgrind by memsetting m_dict to 0 in tdefl_init 29 - Fix resource leak in mz_zip_reader_init_file_v2 30 - Fix assert with mz_zip_writer_add_mem* w/MZ_DEFAULT_COMPRESSION 31 - cmake build: install library and headers 32 - Remove _LARGEFILE64_SOURCE requirement from apple defines for large files 33 34### 2.0.6 35 36 - Improve MZ_ZIP_FLAG_WRITE_ZIP64 documentation 37 - Remove check for cur_archive_file_ofs > UINT_MAX because cur_archive_file_ofs is not used after this point 38 - Add cmake debug configuration 39 - Fix PNG height when creating png files 40 - Add "iterative" file extraction method based on mz_zip_reader_extract_to_callback. 41 - Option to use memcpy for unaligned data access 42 - Define processor/arch macros as zero if not set to one 43 44### 2.0.4/2.0.5 45 46 - Fix compilation with the various omission compile definitions 47 48### 2.0.3 49 50- Fix GCC/clang compile warnings 51- Added callback for periodic flushes (for ZIP file streaming) 52- Use UTF-8 for file names in ZIP files per default 53 54### 2.0.2 55 56- Fix source backwards compatibility with 1.x 57- Fix a ZIP bit not being set correctly 58 59### 2.0.1 60 61- Added some tests 62- Added CI 63- Make source code ANSI C compatible 64 65### 2.0.0 beta 66 67- 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 68- Miniz is now split into several files 69- Miniz does now not seek backwards when creating ZIP files. That is the ZIP files can be streamed 70- Miniz automatically switches to the ZIP64 format when the created ZIP files goes over ZIP file limits 71- 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 72- Miniz 2 is only source back-compatible with miniz 1.x. It breaks binary compatibility because structures changed 73 74### v1.16 BETA Oct 19, 2013 75 76Still testing, this release is downloadable from [here](http://www.tenacioussoftware.com/miniz_v116_beta_r1.7z). Two key inflator-only robustness and streaming related changes. Also merged in tdefl_compressor_alloc(), tdefl_compressor_free() helpers to make script bindings easier for rustyzip. I would greatly appreciate any help with testing or any feedback. 77 78The inflator in raw (non-zlib) mode is now usable on gzip or similar 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. 79 80The inflator now has a new failure status TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS (-4). Previously, if the inflator was starved of bytes and could not make progress (because the input buffer was empty and the caller did not set the TINFL_FLAG_HAS_MORE_INPUT flag - say on truncated or corrupted compressed data stream) it would append all 0's to the input and try to soldier on. This is scary behavior if the caller didn't know when to stop accepting output (because it didn't know how much uncompressed data was expected, or didn't enforce a sane maximum). v1.16 will instead return TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS immediately if it needs 1 or more bytes to make progress, the input buf is empty, and the caller has indicated that no more input is available. This is a "soft" failure, so you can call the inflator again with more input and it will try to continue, or you can give up and fail. This could be very useful in network streaming scenarios. 81 82- 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. 83 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 84 going to mark this release as beta for a few weeks and continue testing it at work/home on various things. 85- 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). 86 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 87 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). 88 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. 89- The inflator now has a new failure status: TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS (-4). Previously, if the inflator was starved of bytes and could not make progress (because the input buffer was empty and the 90 caller did not set the TINFL_FLAG_HAS_MORE_INPUT flag - say on truncated or corrupted compressed data stream) it would append all 0's to the input and try to soldier on. 91 This is scary, because in the worst case, I believe it was possible for the prev. inflator to start outputting large amounts of literal data. If the caller didn't know when to stop accepting output 92 (because it didn't know how much uncompressed data was expected, or didn't enforce a sane maximum) it could continue forever. v1.16 cannot fall into this failure mode, instead it'll return 93 TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS immediately if it needs 1 or more bytes to make progress, the input buf is empty, and the caller has indicated that no more input is available. This is a "soft" 94 failure, so you can call the inflator again with more input and it will try to continue, or you can give up and fail. This could be very useful in network streaming scenarios. 95- Added documentation to all the tinfl return status codes, fixed miniz_tester so it accepts double minus params for Linux, tweaked example1.c, added a simple "follower bytes" test to miniz_tester.cpp. 96### v1.15 r4 STABLE - Oct 13, 2013 97 98Merged over a few very minor bug fixes that I fixed in the zip64 branch. This is downloadable from [here](http://code.google.com/p/miniz/downloads/list) and also in SVN head (as of 10/19/13). 99 100 101### v1.15 - Oct. 13, 2013 102 103Interim 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 kahmyong.moon@hp.com), 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. 104 105- Critical fix for the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY bug (thanks kahmyong.moon@hp.com) which could cause locate files to not find files. This bug 106 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() 107 (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). 108- 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 109- 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. 110 Hopefully this fix won't cause any issues on weird zip archives, because it assumes the low 16-bits of zip external attributes are DOS attributes (which I believe they always are in practice). 111- Fixing mz_zip_reader_is_file_a_directory() so it doesn't check the internal attributes, just the filename and external attributes 112- mz_zip_reader_init_file() - missing MZ_FCLOSE() call if the seek failed 113- Added cmake support for Linux builds which builds all the examples, tested with clang v3.3 and gcc v4.6. 114- Clang fix for tdefl_write_image_to_png_file_in_memory() from toffaletti 115- Merged MZ_FORCEINLINE fix from hdeanclark 116- Fix <time.h> include before config #ifdef, thanks emil.brink 117- Added tdefl_write_image_to_png_file_in_memory_ex(): supports Y flipping (super useful for OpenGL apps), and explicit control over the compression level (so you can 118 set it to 1 for real-time compression). 119- Merged in some compiler fixes from paulharris's github repro. 120- Retested this build under Windows (VS 2010, including static analysis), tcc 0.9.26, gcc v4.6 and clang v3.3. 121- Added example6.c, which dumps an image of the mandelbrot set to a PNG file. 122- Modified example2 to help test the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY flag more. 123- 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 124- 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 125 126### v1.14 - May 20, 2012 127 128(SVN Only) Minor tweaks to get miniz.c compiling with the Tiny C Compiler, added #ifndef MINIZ_NO_TIME guards around utime.h includes. Adding mz_free() function, so the caller can free heap blocks returned by miniz using whatever heap functions it has been configured to use, MSVC specific fixes to use "safe" variants of several functions (localtime_s, fopen_s, freopen_s). 129 130MinGW32/64 GCC 4.6.1 compiler fixes: added MZ_FORCEINLINE, #include <time.h> (thanks fermtect). 131 132Compiler specific fixes, some from fermtect. I upgraded to TDM GCC 4.6.1 and now static __forceinline is giving it fits, so I'm changing all usage of __forceinline to MZ_FORCEINLINE and forcing gcc to use __attribute__((__always_inline__)) (and MSVC to use __forceinline). Also various fixes from fermtect for MinGW32: added #include , 64-bit ftell/fseek fixes. 133 134### v1.13 - May 19, 2012 135 136From jason@cornsyrup.org and kelwert@mtu.edu - Most importantly, fixed mz_crc32() so it doesn't compute the wrong CRC-32's when mz_ulong is 64-bits. Temporarily/locally slammed in "typedef unsigned long mz_ulong" and re-ran a randomized regression test on ~500k files. Other stuff: 137 138Eliminated a bunch of warnings when compiling with GCC 32-bit/64. Ran all examples, miniz.c, and tinfl.c through MSVC 2008's /analyze (static analysis) option and fixed all warnings (except for the silly "Use of the comma-operator in a tested expression.." analysis warning, which I purposely use to work around a MSVC compiler warning). 139 140Created 32-bit and 64-bit Codeblocks projects/workspace. Built and tested Linux executables. The codeblocks workspace is compatible with Linux+Win32/x64. Added miniz_tester solution/project, which is a useful little app derived from LZHAM's tester app that I use as part of the regression test. Ran miniz.c and tinfl.c through another series of regression testing on ~500,000 files and archives. Modified example5.c so it purposely disables a bunch of high-level functionality (MINIZ_NO_STDIO, etc.). (Thanks to corysama for the MINIZ_NO_STDIO bug report.) 141 142Fix ftell() usage in a few of the examples so they exit with an error on files which are too large (a limitation of the examples, not miniz itself). Fix fail logic handling in mz_zip_add_mem_to_archive_file_in_place() so it always calls mz_zip_writer_finalize_archive() and mz_zip_writer_end(), even if the file add fails. 143 144- From jason@cornsyrup.org and kelwert@mtu.edu - Fix mz_crc32() so it doesn't compute the wrong CRC-32's when mz_ulong is 64-bit. 145- Temporarily/locally slammed in "typedef unsigned long mz_ulong" and re-ran a randomized regression test on ~500k files. 146- Eliminated a bunch of warnings when compiling with GCC 32-bit/64. 147- Ran all examples, miniz.c, and tinfl.c through MSVC 2008's /analyze (static analysis) option and fixed all warnings (except for the silly 148"Use of the comma-operator in a tested expression.." analysis warning, which I purposely use to work around a MSVC compiler warning). 149- Created 32-bit and 64-bit Codeblocks projects/workspace. Built and tested Linux executables. The codeblocks workspace is compatible with Linux+Win32/x64. 150- Added miniz_tester solution/project, which is a useful little app derived from LZHAM's tester app that I use as part of the regression test. 151- Ran miniz.c and tinfl.c through another series of regression testing on ~500,000 files and archives. 152- Modified example5.c so it purposely disables a bunch of high-level functionality (MINIZ_NO_STDIO, etc.). (Thanks to corysama for the MINIZ_NO_STDIO bug report.) 153- Fix ftell() usage in examples so they exit with an error on files which are too large (a limitation of the examples, not miniz itself). 154 155### v1.12 - 4/12/12 156 157More comments, added low-level example5.c, fixed a couple minor level_and_flags issues in the archive API's. 158level_and_flags can now be set to MZ_DEFAULT_COMPRESSION. Thanks to Bruce Dawson <bruced@valvesoftware.com> for the feedback/bug report. 159 160### v1.11 - 5/28/11 161 162Added statement from unlicense.org 163 164### v1.10 - 5/27/11 165 166- Substantial compressor optimizations: 167- Level 1 is now ~4x faster than before. The L1 compressor's throughput now varies between 70-110MB/sec. on a Core i7 (actual throughput varies depending on the type of data, and x64 vs. x86). 168- Improved baseline L2-L9 compression perf. Also, greatly improved compression perf. issues on some file types. 169- Refactored the compression code for better readability and maintainability. 170- Added level 10 compression level (L10 has slightly better ratio than level 9, but could have a potentially large drop in throughput on some files). 171 172### v1.09 - 5/15/11 173 174Initial stable release. 175 176 177