1*da0073e9SAndroid Build Coastguard Worker## Changelog 2*da0073e9SAndroid Build Coastguard Worker 3*da0073e9SAndroid Build Coastguard Worker### 2.1.0 4*da0073e9SAndroid Build Coastguard Worker 5*da0073e9SAndroid Build Coastguard Worker - More instances of memcpy instead of cast and use memcpy per default 6*da0073e9SAndroid Build Coastguard Worker - Remove inline for c90 support 7*da0073e9SAndroid Build Coastguard Worker - New function to read files via callback functions when adding them 8*da0073e9SAndroid Build Coastguard Worker - Fix out of bounds read while reading Zip64 extended information 9*da0073e9SAndroid Build Coastguard Worker - guard memcpy when n == 0 because buffer may be NULL 10*da0073e9SAndroid Build Coastguard Worker - Implement inflateReset() function 11*da0073e9SAndroid Build Coastguard Worker - Move comp/decomp alloc/free prototypes under guarding #ifndef MZ_NO_MALLOC 12*da0073e9SAndroid Build Coastguard Worker - Fix large file support under Windows 13*da0073e9SAndroid Build Coastguard Worker - Don't warn if _LARGEFILE64_SOURCE is not defined to 1 14*da0073e9SAndroid Build Coastguard Worker - Fixes for MSVC warnings 15*da0073e9SAndroid Build Coastguard Worker - Remove check that path of file added to archive contains ':' or '\' 16*da0073e9SAndroid Build Coastguard Worker - Add !defined check on MINIZ_USE_ALIGNED_LOADS_AND_STORES 17*da0073e9SAndroid Build Coastguard Worker 18*da0073e9SAndroid Build Coastguard Worker### 2.0.8 19*da0073e9SAndroid Build Coastguard Worker 20*da0073e9SAndroid Build Coastguard Worker - Remove unimplemented functions (mz_zip_locate_file and mz_zip_locate_file_v2) 21*da0073e9SAndroid Build Coastguard Worker - Add license, changelog, readme and example files to release zip 22*da0073e9SAndroid Build Coastguard Worker - Fix heap overflow to user buffer in tinfl_status tinfl_decompress 23*da0073e9SAndroid Build Coastguard Worker - Fix corrupt archive if uncompressed file smaller than 4 byte and the file is added by mz_zip_writer_add_mem* 24*da0073e9SAndroid Build Coastguard Worker 25*da0073e9SAndroid Build Coastguard Worker### 2.0.7 26*da0073e9SAndroid Build Coastguard Worker 27*da0073e9SAndroid Build Coastguard Worker - Removed need in C++ compiler in cmake build 28*da0073e9SAndroid Build Coastguard Worker - Fixed a lot of uninitialized value errors found with Valgrind by memsetting m_dict to 0 in tdefl_init 29*da0073e9SAndroid Build Coastguard Worker - Fix resource leak in mz_zip_reader_init_file_v2 30*da0073e9SAndroid Build Coastguard Worker - Fix assert with mz_zip_writer_add_mem* w/MZ_DEFAULT_COMPRESSION 31*da0073e9SAndroid Build Coastguard Worker - cmake build: install library and headers 32*da0073e9SAndroid Build Coastguard Worker - Remove _LARGEFILE64_SOURCE requirement from apple defines for large files 33*da0073e9SAndroid Build Coastguard Worker 34*da0073e9SAndroid Build Coastguard Worker### 2.0.6 35*da0073e9SAndroid Build Coastguard Worker 36*da0073e9SAndroid Build Coastguard Worker - Improve MZ_ZIP_FLAG_WRITE_ZIP64 documentation 37*da0073e9SAndroid Build Coastguard Worker - Remove check for cur_archive_file_ofs > UINT_MAX because cur_archive_file_ofs is not used after this point 38*da0073e9SAndroid Build Coastguard Worker - Add cmake debug configuration 39*da0073e9SAndroid Build Coastguard Worker - Fix PNG height when creating png files 40*da0073e9SAndroid Build Coastguard Worker - Add "iterative" file extraction method based on mz_zip_reader_extract_to_callback. 41*da0073e9SAndroid Build Coastguard Worker - Option to use memcpy for unaligned data access 42*da0073e9SAndroid Build Coastguard Worker - Define processor/arch macros as zero if not set to one 43*da0073e9SAndroid Build Coastguard Worker 44*da0073e9SAndroid Build Coastguard Worker### 2.0.4/2.0.5 45*da0073e9SAndroid Build Coastguard Worker 46*da0073e9SAndroid Build Coastguard Worker - Fix compilation with the various omission compile definitions 47*da0073e9SAndroid Build Coastguard Worker 48*da0073e9SAndroid Build Coastguard Worker### 2.0.3 49*da0073e9SAndroid Build Coastguard Worker 50*da0073e9SAndroid Build Coastguard Worker- Fix GCC/clang compile warnings 51*da0073e9SAndroid Build Coastguard Worker- Added callback for periodic flushes (for ZIP file streaming) 52*da0073e9SAndroid Build Coastguard Worker- Use UTF-8 for file names in ZIP files per default 53*da0073e9SAndroid Build Coastguard Worker 54*da0073e9SAndroid Build Coastguard Worker### 2.0.2 55*da0073e9SAndroid Build Coastguard Worker 56*da0073e9SAndroid Build Coastguard Worker- Fix source backwards compatibility with 1.x 57*da0073e9SAndroid Build Coastguard Worker- Fix a ZIP bit not being set correctly 58*da0073e9SAndroid Build Coastguard Worker 59*da0073e9SAndroid Build Coastguard Worker### 2.0.1 60*da0073e9SAndroid Build Coastguard Worker 61*da0073e9SAndroid Build Coastguard Worker- Added some tests 62*da0073e9SAndroid Build Coastguard Worker- Added CI 63*da0073e9SAndroid Build Coastguard Worker- Make source code ANSI C compatible 64*da0073e9SAndroid Build Coastguard Worker 65*da0073e9SAndroid Build Coastguard Worker### 2.0.0 beta 66*da0073e9SAndroid Build Coastguard Worker 67*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker- Miniz is now split into several files 69*da0073e9SAndroid Build Coastguard Worker- Miniz does now not seek backwards when creating ZIP files. That is the ZIP files can be streamed 70*da0073e9SAndroid Build Coastguard Worker- Miniz automatically switches to the ZIP64 format when the created ZIP files goes over ZIP file limits 71*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker- Miniz 2 is only source back-compatible with miniz 1.x. It breaks binary compatibility because structures changed 73*da0073e9SAndroid Build Coastguard Worker 74*da0073e9SAndroid Build Coastguard Worker### v1.16 BETA Oct 19, 2013 75*da0073e9SAndroid Build Coastguard Worker 76*da0073e9SAndroid Build Coastguard WorkerStill 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*da0073e9SAndroid Build Coastguard Worker 78*da0073e9SAndroid Build Coastguard WorkerThe 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*da0073e9SAndroid Build Coastguard Worker 80*da0073e9SAndroid Build Coastguard WorkerThe 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*da0073e9SAndroid Build Coastguard Worker 82*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker 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*da0073e9SAndroid Build Coastguard Worker going to mark this release as beta for a few weeks and continue testing it at work/home on various things. 85*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker 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*da0073e9SAndroid Build Coastguard Worker 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*da0073e9SAndroid Build Coastguard Worker 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*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker 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*da0073e9SAndroid Build Coastguard Worker 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*da0073e9SAndroid Build Coastguard Worker (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*da0073e9SAndroid Build Coastguard Worker 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*da0073e9SAndroid Build Coastguard Worker 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*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker### v1.15 r4 STABLE - Oct 13, 2013 97*da0073e9SAndroid Build Coastguard Worker 98*da0073e9SAndroid Build Coastguard WorkerMerged 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*da0073e9SAndroid Build Coastguard Worker 100*da0073e9SAndroid Build Coastguard Worker 101*da0073e9SAndroid Build Coastguard Worker### v1.15 - Oct. 13, 2013 102*da0073e9SAndroid Build Coastguard Worker 103*da0073e9SAndroid Build Coastguard WorkerInterim 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. 104*da0073e9SAndroid Build Coastguard Worker 105*da0073e9SAndroid Build Coastguard Worker- 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 106*da0073e9SAndroid Build Coastguard Worker 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*da0073e9SAndroid Build Coastguard Worker (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*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker 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*da0073e9SAndroid Build Coastguard Worker- Fixing mz_zip_reader_is_file_a_directory() so it doesn't check the internal attributes, just the filename and external attributes 112*da0073e9SAndroid Build Coastguard Worker- mz_zip_reader_init_file() - missing MZ_FCLOSE() call if the seek failed 113*da0073e9SAndroid Build Coastguard Worker- Added cmake support for Linux builds which builds all the examples, tested with clang v3.3 and gcc v4.6. 114*da0073e9SAndroid Build Coastguard Worker- Clang fix for tdefl_write_image_to_png_file_in_memory() from toffaletti 115*da0073e9SAndroid Build Coastguard Worker- Merged MZ_FORCEINLINE fix from hdeanclark 116*da0073e9SAndroid Build Coastguard Worker- Fix <time.h> include before config #ifdef, thanks emil.brink 117*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker set it to 1 for real-time compression). 119*da0073e9SAndroid Build Coastguard Worker- Merged in some compiler fixes from paulharris's github repro. 120*da0073e9SAndroid Build Coastguard Worker- Retested this build under Windows (VS 2010, including static analysis), tcc 0.9.26, gcc v4.6 and clang v3.3. 121*da0073e9SAndroid Build Coastguard Worker- Added example6.c, which dumps an image of the mandelbrot set to a PNG file. 122*da0073e9SAndroid Build Coastguard Worker- Modified example2 to help test the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY flag more. 123*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker 126*da0073e9SAndroid Build Coastguard Worker### v1.14 - May 20, 2012 127*da0073e9SAndroid Build Coastguard Worker 128*da0073e9SAndroid Build Coastguard Worker(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*da0073e9SAndroid Build Coastguard Worker 130*da0073e9SAndroid Build Coastguard WorkerMinGW32/64 GCC 4.6.1 compiler fixes: added MZ_FORCEINLINE, #include <time.h> (thanks fermtect). 131*da0073e9SAndroid Build Coastguard Worker 132*da0073e9SAndroid Build Coastguard WorkerCompiler 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*da0073e9SAndroid Build Coastguard Worker 134*da0073e9SAndroid Build Coastguard Worker### v1.13 - May 19, 2012 135*da0073e9SAndroid Build Coastguard Worker 136*da0073e9SAndroid Build Coastguard WorkerFrom [email protected] and [email protected] - 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*da0073e9SAndroid Build Coastguard Worker 138*da0073e9SAndroid Build Coastguard WorkerEliminated 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*da0073e9SAndroid Build Coastguard Worker 140*da0073e9SAndroid Build Coastguard WorkerCreated 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*da0073e9SAndroid Build Coastguard Worker 142*da0073e9SAndroid Build Coastguard WorkerFix 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*da0073e9SAndroid Build Coastguard Worker 144*da0073e9SAndroid Build Coastguard Worker- From [email protected] and [email protected] - Fix mz_crc32() so it doesn't compute the wrong CRC-32's when mz_ulong is 64-bit. 145*da0073e9SAndroid Build Coastguard Worker- Temporarily/locally slammed in "typedef unsigned long mz_ulong" and re-ran a randomized regression test on ~500k files. 146*da0073e9SAndroid Build Coastguard Worker- Eliminated a bunch of warnings when compiling with GCC 32-bit/64. 147*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker"Use of the comma-operator in a tested expression.." analysis warning, which I purposely use to work around a MSVC compiler warning). 149*da0073e9SAndroid Build Coastguard Worker- Created 32-bit and 64-bit Codeblocks projects/workspace. Built and tested Linux executables. The codeblocks workspace is compatible with Linux+Win32/x64. 150*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker- Ran miniz.c and tinfl.c through another series of regression testing on ~500,000 files and archives. 152*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker 155*da0073e9SAndroid Build Coastguard Worker### v1.12 - 4/12/12 156*da0073e9SAndroid Build Coastguard Worker 157*da0073e9SAndroid Build Coastguard WorkerMore comments, added low-level example5.c, fixed a couple minor level_and_flags issues in the archive API's. 158*da0073e9SAndroid Build Coastguard Workerlevel_and_flags can now be set to MZ_DEFAULT_COMPRESSION. Thanks to Bruce Dawson <[email protected]> for the feedback/bug report. 159*da0073e9SAndroid Build Coastguard Worker 160*da0073e9SAndroid Build Coastguard Worker### v1.11 - 5/28/11 161*da0073e9SAndroid Build Coastguard Worker 162*da0073e9SAndroid Build Coastguard WorkerAdded statement from unlicense.org 163*da0073e9SAndroid Build Coastguard Worker 164*da0073e9SAndroid Build Coastguard Worker### v1.10 - 5/27/11 165*da0073e9SAndroid Build Coastguard Worker 166*da0073e9SAndroid Build Coastguard Worker- Substantial compressor optimizations: 167*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker- Improved baseline L2-L9 compression perf. Also, greatly improved compression perf. issues on some file types. 169*da0073e9SAndroid Build Coastguard Worker- Refactored the compression code for better readability and maintainability. 170*da0073e9SAndroid Build Coastguard Worker- 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*da0073e9SAndroid Build Coastguard Worker 172*da0073e9SAndroid Build Coastguard Worker### v1.09 - 5/15/11 173*da0073e9SAndroid Build Coastguard Worker 174*da0073e9SAndroid Build Coastguard WorkerInitial stable release. 175*da0073e9SAndroid Build Coastguard Worker 176*da0073e9SAndroid Build Coastguard Worker 177