mirror of
				https://github.com/eledio-devices/thirdparty-miniz.git
				synced 2025-10-31 00:32:38 +01:00 
			
		
		
		
	Add v1.16 beta r1 changes.
This commit is contained in:
		
							
								
								
									
										19
									
								
								miniz.h
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								miniz.h
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | ||||
| /* miniz.c v1.15 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing | ||||
| /* miniz.c v1.16 beta r1 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing | ||||
|    See "unlicense" statement at the end of this file. | ||||
|    Rich Geldreich <richgel99@gmail.com>, last updated Oct. 13, 2013 | ||||
|    Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and RFC 1951: http://www.ietf.org/rfc/rfc1951.txt | ||||
| @@ -7,6 +7,21 @@ | ||||
|    MINIZ_NO_ARCHIVE_APIS, or to get rid of all stdio usage define MINIZ_NO_STDIO (see the list below for more macros). | ||||
|  | ||||
|    * Change History | ||||
|      10/19/13 v1.16 beta r1 - 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. | ||||
|        - 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 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. | ||||
|        - 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 | ||||
|          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, 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 | ||||
|          (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 | ||||
|          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. | ||||
|        - 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. | ||||
|      10/13/13 v1.15 r4 - Interim bugfix release while I work on the next major release with Zip64 support (almost there!): | ||||
|        - 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 | ||||
|         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() | ||||
| @@ -160,7 +175,6 @@ | ||||
| #include "miniz_common.h" | ||||
| #include "miniz_tinfl.h" | ||||
| #include "miniz_tdef.h" | ||||
| //#include "miniz_zip.h" | ||||
|  | ||||
| // Defines to completely disable specific portions of miniz.c: | ||||
| // If all macros here are defined the only functionality remaining will be CRC-32, adler-32, tinfl, and tdefl. | ||||
| @@ -254,6 +268,7 @@ typedef void *(*mz_alloc_func)(void *opaque, size_t items, size_t size); | ||||
| typedef void (*mz_free_func)(void *opaque, void *address); | ||||
| typedef void *(*mz_realloc_func)(void *opaque, void *address, size_t items, size_t size); | ||||
|  | ||||
| // TODO: I can't encode "1.16" here, argh | ||||
| #define MZ_VERSION          "9.1.15" | ||||
| #define MZ_VERNUM           0x91F0 | ||||
| #define MZ_VER_MAJOR        9 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user