diff options
author | Glenn Randers-Pehrson <glennrp@shaggy.simplesystems.org> | 2010-03-13 07:55:49 -0600 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp@shaggy.simplesystems.org> | 2010-03-13 07:55:49 -0600 |
commit | aa1f7d6c52644fe127ff81b669818c19bc61714e (patch) | |
tree | cb6d3b14b47ba6a125a9dfc143d0139197013b7b | |
parent | 8ad88163f79d5b8ab95147d4dd7bde440c5d0a4a (diff) | |
download | libpng-aa1f7d6c52644fe127ff81b669818c19bc61714e.tar.gz |
Added missing "(...)" in png_get_uint_32(); revised help info for "-zitxt".v1.7.10
Only compile png_get_uint_32(), etc., when PNG_LIBPNG_VER < 1.2.9
Updated zlib to latest 1.2.3.9 release of March 11, 2010.
-rw-r--r-- | ChangeLog.html | 5 | ||||
-rw-r--r-- | deflate.c | 12 | ||||
-rw-r--r-- | deflate.h | 4 | ||||
-rw-r--r-- | inftrees.c | 4 | ||||
-rw-r--r-- | pngcrush.c | 36 | ||||
-rw-r--r-- | pngrutil.c | 7 | ||||
-rw-r--r-- | trees.c | 20 | ||||
-rw-r--r-- | zlib.h | 3 |
8 files changed, 55 insertions, 36 deletions
diff --git a/ChangeLog.html b/ChangeLog.html index b66c9924d..f5815ccbb 100644 --- a/ChangeLog.html +++ b/ChangeLog.html @@ -3,6 +3,11 @@ Change log: +Version 1.7.10 (built with libpng-1.4.1 and zlib-1.2.3.9) + Added missing "(...)" in png_get_uint_32(). + Only compile png_get_uint_32(), etc., when PNG_LIBPNG_VER < 1.2.9 + Revised help info for "-zitxt". + Version 1.7.9 (built with libpng-1.4.1 and zlib-1.2.3.9) Defined TOO_FAR == 32767 in pngcrush.h (instead of in deflate.c) Revised the "nolib" Makefiles to remove reference to gzio.c and @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.3.9 Copyright 1995-2010 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.4 Copyright 1995-2010 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -1433,21 +1433,21 @@ local void fill_window(s) * Flush the current block, with given end-of-file flag. * IN assertion: strstart is set to the end of the current match. */ -#define FLUSH_BLOCK_ONLY(s, eof) { \ +#define FLUSH_BLOCK_ONLY(s, last) { \ _tr_flush_block(s, (s->block_start >= 0L ? \ (charf *)&s->window[(unsigned)s->block_start] : \ (charf *)Z_NULL), \ (ulg)((long)s->strstart - s->block_start), \ - (eof)); \ + (last)); \ s->block_start = s->strstart; \ flush_pending(s->strm); \ Tracev((stderr,"[FLUSH]")); \ } /* Same but force premature exit if necessary. */ -#define FLUSH_BLOCK(s, eof) { \ - FLUSH_BLOCK_ONLY(s, eof); \ - if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \ +#define FLUSH_BLOCK(s, last) { \ + FLUSH_BLOCK_ONLY(s, last); \ + if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \ } /* =========================================================================== @@ -293,10 +293,10 @@ typedef struct internal_state { void _tr_init OF((deflate_state *s)); int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, - int eof)); + int last)); void _tr_align OF((deflate_state *s)); void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, - int eof)); + int last)); #define d_code(dist) \ ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) diff --git a/inftrees.c b/inftrees.c index b7667998a..3ee7d0636 100644 --- a/inftrees.c +++ b/inftrees.c @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.3.9 Copyright 1995-2010 Mark Adler "; + " inflate 1.2.4 Copyright 1995-2010 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -62,7 +62,7 @@ unsigned short FAR *work; 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 193, 201}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 66, 199}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, diff --git a/pngcrush.c b/pngcrush.c index c9f5e8238..29d819024 100644 --- a/pngcrush.c +++ b/pngcrush.c @@ -57,7 +57,7 @@ * */ -#define PNGCRUSH_VERSION "1.7.9" +#define PNGCRUSH_VERSION "1.7.10" /* #define PNGCRUSH_COUNT_COLORS @@ -160,6 +160,11 @@ Change log: +Version 1.7.10 (built with libpng-1.4.1 and zlib-1.2.3.9) + Added missing "(...)" in png_get_uint_32(). + Only compile png_get_uint_32(), etc., when PNG_LIBPNG_VER < 1.2.9 + Revised help info for "-zitxt". + Version 1.7.9 (built with libpng-1.4.1 and zlib-1.2.3.9) Defined TOO_FAR == 32767 in pngcrush.h (instead of in deflate.c) Revised the "nolib" Makefiles to remove reference to gzio.c and @@ -1251,21 +1256,24 @@ void print_usage(int retval); * ============================================================ */ -#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED + +# if (PNG_LIBPNG_VER < 10209) +# ifndef PNG_READ_BIG_ENDIAN_SUPPORTED /* Grab an unsigned 32-bit integer from a buffer in big-endian format. */ png_uint_32 /* PRIVATE */ png_get_uint_32(png_bytep buf) { - png_uint_32 i = ((png_uint_32)(*buf) << 24) + + png_uint_32 i = + ((png_uint_32)(*(buf )) << 24) + ((png_uint_32)(*(buf + 1)) << 16) + - ((png_uint_32)(*(buf + 2)) << 8) + - (png_uint_32)(*(buf + 3)); + ((png_uint_32)(*(buf + 2)) << 8) + + ((png_uint_32)(*(buf + 3)) ) ; return (i); } -#else -# define png_get_uint_32(buf) ( *((png_uint_32p) (buf))) -#endif +# else +# define png_get_uint_32(buf) ( *((png_uint_32p) (buf))) +# endif png_uint_32 /* PRIVATE */ png_get_uint_31(png_structp png_ptr, png_bytep buf) { @@ -1282,6 +1290,7 @@ png_save_uint_32(png_bytep buf, png_uint_32 i) buf[2] = (png_byte)((i >> 8) & 0xff); buf[3] = (png_byte)(i & 0xff); } +# endif /* PNG_LIBPNG_VER < 10209 */ /* * Reset the CRC variable to 32 bits of 1's. Care must be taken @@ -3447,12 +3456,14 @@ int main(int argc, char *argv[]) for (;;) { - png_size_t num_in; + png_size_t num_in, num_out; num_in = fread(buffer, 1, 1, fpin); if (!num_in) break; - fwrite(buffer, 1, 1, fpout); + num_out = fwrite(buffer, 1, 1, fpout); + if (num_out != num_in) + P2("copy error.\n"); } P2("copy complete.\n"); png_crush_pause(); @@ -7139,9 +7150,10 @@ struct options_help pngcrush_options[] = { {2, ""}, #ifdef PNG_iTXt_SUPPORTED - {0, " -zitxt b[efore_IDAT]|a[fter_IDAT] \"keyword\""}, - {2, " \"language_code\" \"translated_keyword\" \"text\""}, + {0, " -zitxt b|a \"keyword\" \"lcode\" \"tkey\" \"text\""}, {2, ""}, + {2, " (where \"lcode\"==language_code and"}, + {2, " \"tkey\"==translated_keyword)\""}, {2, " Compressed iTXt chunk to insert (see -text)."}, {2, ""}, #endif diff --git a/pngrutil.c b/pngrutil.c index 47b0eea2a..64aa961e0 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -33,10 +33,11 @@ png_get_uint_31(png_structp png_ptr, png_bytep buf) png_uint_32 PNGAPI png_get_uint_32(png_bytep buf) { - png_uint_32 i = ((png_uint_32)(*buf) << 24) + + png_uint_32 i = + ((png_uint_32)(*(buf )) << 24) + ((png_uint_32)(*(buf + 1)) << 16) + - ((png_uint_32)(*(buf + 2)) << 8) + - (png_uint_32)(*(buf + 3)); + ((png_uint_32)(*(buf + 2)) << 8) + + ((png_uint_32)(*(buf + 3)) ) ; return (i); } @@ -867,13 +867,13 @@ local void send_all_trees(s, lcodes, dcodes, blcodes) /* =========================================================================== * Send a stored block */ -void _tr_stored_block(s, buf, stored_len, eof) +void _tr_stored_block(s, buf, stored_len, last) deflate_state *s; charf *buf; /* input block */ ulg stored_len; /* length of input block */ - int eof; /* true if this is the last block for a file */ + int last; /* one if this is the last block for a file */ { - send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */ + send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */ #ifdef DEBUG s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; s->compressed_len += (stored_len + 4) << 3; @@ -921,11 +921,11 @@ void _tr_align(s) * Determine the best encoding for the current block: dynamic trees, static * trees or store, and output the encoded block to the zip file. */ -void _tr_flush_block(s, buf, stored_len, eof) +void _tr_flush_block(s, buf, stored_len, last) deflate_state *s; charf *buf; /* input block, or NULL if too old */ ulg stored_len; /* length of input block */ - int eof; /* true if this is the last block for a file */ + int last; /* one if this is the last block for a file */ { ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ int max_blindex = 0; /* index of last bit length code of non zero freq */ @@ -981,20 +981,20 @@ void _tr_flush_block(s, buf, stored_len, eof) * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to * transform a block into a stored block. */ - _tr_stored_block(s, buf, stored_len, eof); + _tr_stored_block(s, buf, stored_len, last); #ifdef FORCE_STATIC } else if (static_lenb >= 0) { /* force static trees */ #else } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { #endif - send_bits(s, (STATIC_TREES<<1)+eof, 3); + send_bits(s, (STATIC_TREES<<1)+last, 3); compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree); #ifdef DEBUG s->compressed_len += 3 + s->static_len; #endif } else { - send_bits(s, (DYN_TREES<<1)+eof, 3); + send_bits(s, (DYN_TREES<<1)+last, 3); send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, max_blindex+1); compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree); @@ -1008,14 +1008,14 @@ void _tr_flush_block(s, buf, stored_len, eof) */ init_block(s); - if (eof) { + if (last) { bi_windup(s); #ifdef DEBUG s->compressed_len += 7; /* align on byte boundary */ #endif } Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, - s->compressed_len-7*eof)); + s->compressed_len-7*last)); } /* =========================================================================== @@ -1,5 +1,5 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.3.9, Feb 21st, 2010 + version 1.2.3.9, Mar 11th, 2010 Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler @@ -42,6 +42,7 @@ extern "C" { #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 2 #define ZLIB_VER_REVISION 3 +#define ZLIB_VER_SUBREVISION 9 /* The 'zlib' compression library provides in-memory compression and |