summaryrefslogtreecommitdiff
path: root/inflate.c
AgeCommit message (Collapse)Author
2017-01-31Add option to not compute or check check values.Mark Adler
The undocumented (except in these commit comments) function inflateValidate(strm, check) can be called after an inflateInit(), inflateInit2(), or inflateReset2() with check equal to zero to turn off the check value (CRC-32 or Adler-32) computation and comparison. Calling with check not equal to zero turns checking back on. This should only be called immediately after the init or reset function. inflateReset() does not change the state, so a previous inflateValidate() setting will remain in effect. This also turns off validation of the gzip header CRC when present. This should only be used when a zlib or gzip stream has already been checked, and repeated decompressions of the same stream no longer need to be validated.
2017-01-31Fix shift of negative value in inflateMark().Mika Lindqvist
2017-01-31Replace Z_NULL with NULL. Fix incorrect uses of NULL/Z_NULL.Mika Lindqvist
2017-01-30local -> staticMika Lindqvist
* local -> static * Normalize and cleanup line-endings * Fix warnings under Visual Studio. * Whitespace cleanup *** This patch has been edited to merge cleanly and to exclude type changes. Based on 8d7a7c3b82c6e38734bd504dac800b148ab410d0 "Type Cleanup"
2015-12-14Use size_t for total_in and total_out.Mika Lindqvist
2015-12-14Type cleanup.Mika Lindqvist
2015-12-13Fix bug that accepted invalid zlib header when windowBits is zero.Mark Adler
When windowBits is zero, the size of the sliding window comes from the zlib header. The allowed values of the four-bit field are 0..7, but when windowBits is zero, values greater than 7 are permitted and acted upon, resulting in large, mostly unused memory allocations. This fix rejects such invalid zlib headers.
2015-11-03Clean up portability for shifts and integer sizes.Mark Adler
2015-11-03Fix inflateInit2() bug when windowBits is 16 or 32.Mark Adler
A windowBits value of 0, 16, or 32 gets the window bits from the zlib header. However there is no zlib header for 16, or for 32 when the input is gzip. This commit sets the window bits for inflate to 15 if a gzip stream is detected and windowBits was 16 or 32. (cherry picked from commit 0db8fd371477f42c280ddeee29e6de092fabf948)
2015-11-03Remedy Coverity warning. [Randers-Pehrson]Mark Adler
Conflicts: inflate.c
2015-06-05Revert "Replace 'unsigned long' with most suitable fixed-size type."Hans Kristian Rosbach
This commit was cherry-picked and was not done, resulting in a few problems with gcc on 64bit windows. This reverts commit edd7a72e056b994458ff040d4740b16b35336b60. Conflicts: arch/x86/crc_folding.c arch/x86/fill_window_sse.c deflate.c deflate.h match.c trees.c
2015-05-25Style cleanup for inflate codeHans Kristian Rosbach
2015-05-23Replace 'unsigned long' with most suitable fixed-size type.Mika Lindqvist
2015-05-22Replace (void *)0 with NULL.Mika Lindqvist
2015-05-22Replace unsigned short with uint16_tHans Kristian Rosbach
Conflicts: inflate.h inftrees.c inftrees.h match.c
2015-05-17Kill Byte and BytefDaniel Axtens
Signed-off-by: Daniel Axtens <dja@axtens.net> Conflicts: adler32.c compress.c deflate.c inflate.c match.c test/example.c uncompr.c zlib.h
2015-05-13z_const -> constDaniel Axtens
Signed-off-by: Daniel Axtens <dja@axtens.net> Conflicts: arch/x86/crc_folding.c crc32.c
2015-05-12Convert remaining K&R function declarations to ANSI-C declarations.Hans Kristian Rosbach
2015-05-12Remove support for compiling with Z_SOLO.Hans Kristian Rosbach
Make compiling without gzip file operation support the default (define WITH_GZFILEOP or use --zlib-compat to enable them). Add initial support for compiling in a zlib-compatible mode, this currently only enables gzip file operations and sets the ZLIB_COMPAT flag. Conflicts: test/minigzip.c
2015-04-26Cleanup: Replace 'z_streamp' with 'z_stream *'Hans Kristian Rosbach
2015-04-26Cleanup: Replace 'voidp' with 'void *'Hans Kristian Rosbach
2015-04-26Use memcpy, memcmp and memzero directlyHans Kristian Rosbach
2014-10-18Rewrite K&R-style function prototypes to ANSI-C-style.hansr
Only internal functions, no exported functions in this commit.
2014-10-18Remove FAR variants of voidpfhansr
And a few Bytef leftovers from test/example.c
2014-10-16Remove FAR variants of variables ushf, schf, Posf, Bytef, charf,hansr
intf, uIntf and uLongf
2014-10-12Remove workarounds for non-ANSI-C compatible compilers (Part 2)hansr
-Removing usage of OF() definition
2014-10-09Remove FAR definitionhansr
Remove a few leftovers from the legacy OS support removal
2012-08-13Clean up the usage of z_const and respect const usage within zlib.Mark Adler
This patch allows zlib to compile cleanly with the -Wcast-qual gcc warning enabled, but only if ZLIB_CONST is defined, which adds const to next_in and msg in z_stream and in the in_func prototype. A --const option is added to ./configure which adds -DZLIB_CONST to the compile flags, and adds -Wcast-qual to the compile flags when ZLIBGCCWARN is set in the environment.
2012-05-26Add inflateGetDictionary() function.Mark Adler
2012-02-12zlib 1.2.6.1Mark Adler
2012-02-11Use optimized byte swap operations for Microsoft and GNU [Snyder].Mark Adler
2012-01-29Avoid the use of the Objective-C reserved name "id".Mark Adler
2011-12-18zlib 1.2.5.2Mark Adler
2011-12-10Do not set strm->adler when doing raw inflate.Mark Adler
2011-12-10Have inflate() with Z_FINISH avoid the allocation of a window.Mark Adler
inflate() avoided that allocation normally, until it was modified to update the window on a normal completion so that inflateResetKeep() could work. This patch restores that behavior, but only when Z_FINISH is used successfully to complete an inflation of a stream in a single call of inflate(). The comments in zlib.h have been updated accordingly.
2011-12-08Enable dictionary setting in middle of stream, and keeping the dictionary.Mark Adler
This patch adds the deflateResetKeep() function to retain the sliding window for the next deflate operation, and fixes an inflateResetKeep() problem that came from inflate() not updating the window when the stream completed. This enables constructing and decompressing a series of concatenated deflate streams where each can depend on the history of uncompressed data that precedes it. This generalizes deflateSetDictionary() and inflateSetDictionary() to permit setting the dictionary in the middle of a stream for raw deflate and inflate. This in combination with the Keep functions enables a scheme for updating files block by block with the transmission of compressed data, where blocks are sent with deflateResetKeep() to retain history for better compression, and deflateSetDictionary() is used for blocks already present at the receiver to skip compression but insert that data in the history, again for better compression. The corresponding inflate calls are done on the receiver side.
2011-11-27Remove code from inflate.c and infback.c that is impossible to execute.Mark Adler
During coverage testing it was discovered that these two lines could never pull more bits, since the immediately preceding for loop assures that all of the code's bits are already pulled.
2011-10-09Fix indentation of code in inflate.c.Mark Adler
2011-10-07Add undocumented inflateResetKeep() function for CAB file decoding.Mark Adler
The Microsoft CAB file format compresses each block with completed deflate streams that depend on the sliding window history of the previous block in order to decode. inflateResetKeep() does what inflateReset() does, except the sliding window history from the previous inflate operation is retained.
2011-10-07Add a ./config --solo option to make zlib subset with no libary useMark Adler
A common request has been the ability to compile zlib to require no other libraries. This --solo option provides that ability. The price is that the gz*, compress*, and uncompress functions are eliminated, and that the user must provide memory allocation and free routines to deflate and inflate when initializing.
2011-10-05Get inffixed.h and MAKEFIXED result to match.Mark Adler
2011-09-09zlib 1.2.3.7Mark Adler
2011-09-09zlib 1.2.3.6Mark Adler
2011-09-09zlib 1.2.3.5Mark Adler
2011-09-09zlib 1.2.3.4Mark Adler
2011-09-09zlib 1.2.3.3Mark Adler
2011-09-09zlib 1.2.2.4Mark Adler
2011-09-09zlib 1.2.2.3Mark Adler
2011-09-09zlib 1.2.2.2Mark Adler
2011-09-09zlib 1.2.2.1Mark Adler