diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2016-11-05 22:55:34 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2016-12-04 07:39:37 -0800 |
commit | 9674807c82ae06716a678d7374362acdb6f041b5 (patch) | |
tree | d2d36ae6ece89435bfdf7b21b766866a4bbf32b4 /deflate.h | |
parent | fc130cdd9fcb0ea4decaf003be6ddf4c5dfd5760 (diff) | |
download | zlib-9674807c82ae06716a678d7374362acdb6f041b5.tar.gz |
Fix bugs in creating a very large gzip header.
Diffstat (limited to 'deflate.h')
-rw-r--r-- | deflate.h | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -51,13 +51,16 @@ #define Buf_size 16 /* size of bit buffer in bi_buf */ -#define INIT_STATE 42 -#define EXTRA_STATE 69 -#define NAME_STATE 73 -#define COMMENT_STATE 91 -#define HCRC_STATE 103 -#define BUSY_STATE 113 -#define FINISH_STATE 666 +#define INIT_STATE 42 /* zlib header -> BUSY_STATE */ +#ifdef GZIP +# define GZIP_STATE 57 /* gzip header -> BUSY_STATE | EXTRA_STATE */ +#endif +#define EXTRA_STATE 69 /* gzip extra block -> NAME_STATE */ +#define NAME_STATE 73 /* gzip file name -> COMMENT_STATE */ +#define COMMENT_STATE 91 /* gzip comment -> HCRC_STATE */ +#define HCRC_STATE 103 /* gzip header CRC -> BUSY_STATE */ +#define BUSY_STATE 113 /* deflate -> FINISH_STATE */ +#define FINISH_STATE 666 /* stream complete */ /* Stream status */ @@ -100,10 +103,10 @@ typedef struct internal_state { Bytef *pending_buf; /* output still pending */ ulg pending_buf_size; /* size of pending_buf */ Bytef *pending_out; /* next pending byte to output to the stream */ - uInt pending; /* nb of bytes in the pending buffer */ + ulg pending; /* nb of bytes in the pending buffer */ int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ gz_headerp gzhead; /* gzip header information to write */ - uInt gzindex; /* where in extra, name, or comment */ + ulg gzindex; /* where in extra, name, or comment */ Byte method; /* can only be DEFLATED */ int last_flush; /* value of flush param for previous deflate call */ |