diff options
| author | Brian Feldman <green@FreeBSD.org> | 2002-03-11 22:36:26 +0000 | 
|---|---|---|
| committer | Brian Feldman <green@FreeBSD.org> | 2002-03-11 22:36:26 +0000 | 
| commit | 4d22b11a56999255d263ddecadfbe73b9a80030d (patch) | |
| tree | bff2461c1653758bf9b8443f106c8627f9369418 | |
| parent | 422658d92461cf1f8c1121f44057d99b5d4ac228 (diff) | |
Notes
| -rw-r--r-- | lib/libz/adler32.c | 2 | ||||
| -rw-r--r-- | lib/libz/compress.c | 2 | ||||
| -rw-r--r-- | lib/libz/crc32.c | 2 | ||||
| -rw-r--r-- | lib/libz/deflate.c | 6 | ||||
| -rw-r--r-- | lib/libz/deflate.h | 2 | ||||
| -rw-r--r-- | lib/libz/example.c | 2 | ||||
| -rw-r--r-- | lib/libz/gzio.c | 2 | ||||
| -rw-r--r-- | lib/libz/infblock.c | 12 | ||||
| -rw-r--r-- | lib/libz/infcodes.c | 12 | ||||
| -rw-r--r-- | lib/libz/inffast.c | 47 | ||||
| -rw-r--r-- | lib/libz/inflate.c | 2 | ||||
| -rw-r--r-- | lib/libz/inftrees.c | 9 | ||||
| -rw-r--r-- | lib/libz/infutil.c | 2 | ||||
| -rw-r--r-- | lib/libz/maketree.c | 2 | ||||
| -rw-r--r-- | lib/libz/minigzip.c | 2 | ||||
| -rw-r--r-- | lib/libz/trees.c | 2 | ||||
| -rw-r--r-- | lib/libz/uncompr.c | 2 | ||||
| -rw-r--r-- | lib/libz/zconf.h | 2 | ||||
| -rw-r--r-- | lib/libz/zlib.3 | 6 | ||||
| -rw-r--r-- | lib/libz/zutil.c | 2 | ||||
| -rw-r--r-- | lib/libz/zutil.h | 2 | 
21 files changed, 65 insertions, 57 deletions
diff --git a/lib/libz/adler32.c b/lib/libz/adler32.c index 5af4ea3f8ddf..1310efe6c27a 100644 --- a/lib/libz/adler32.c +++ b/lib/libz/adler32.c @@ -1,5 +1,5 @@  /* adler32.c -- compute the Adler-32 checksum of a data stream - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler   * For conditions of distribution and use, see copyright notice in zlib.h    */ diff --git a/lib/libz/compress.c b/lib/libz/compress.c index 9db5703ab96d..cc9a4e078c7a 100644 --- a/lib/libz/compress.c +++ b/lib/libz/compress.c @@ -1,5 +1,5 @@  /* compress.c -- compress a memory buffer - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly.   * For conditions of distribution and use, see copyright notice in zlib.h    */ diff --git a/lib/libz/crc32.c b/lib/libz/crc32.c index 32ea0ebff9d4..eee1adbeae22 100644 --- a/lib/libz/crc32.c +++ b/lib/libz/crc32.c @@ -1,5 +1,5 @@  /* crc32.c -- compute the CRC-32 of a data stream - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler   * For conditions of distribution and use, see copyright notice in zlib.h    */ diff --git a/lib/libz/deflate.c b/lib/libz/deflate.c index 57fbe9ab01d1..0866ecab0034 100644 --- a/lib/libz/deflate.c +++ b/lib/libz/deflate.c @@ -1,5 +1,5 @@  /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly.   * For conditions of distribution and use, see copyright notice in zlib.h    */ @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$");  #include "deflate.h"  const char deflate_copyright[] = -   " deflate 1.1.3 Copyright 1995-1998 Jean-loup Gailly "; +   " deflate 1.1.4 Copyright 1995-2002 Jean-loup Gailly ";  /*    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 @@ -245,7 +245,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,          windowBits = -windowBits;      }      if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || -        windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || +        windowBits < 9 || windowBits > 15 || level < 0 || level > 9 ||  	strategy < 0 || strategy > Z_HUFFMAN_ONLY) {          return Z_STREAM_ERROR;      } diff --git a/lib/libz/deflate.h b/lib/libz/deflate.h index 998528880454..a647998ea44d 100644 --- a/lib/libz/deflate.h +++ b/lib/libz/deflate.h @@ -1,5 +1,5 @@  /* deflate.h -- internal compression state - * Copyright (C) 1995-1998 Jean-loup Gailly + * Copyright (C) 1995-2002 Jean-loup Gailly   * For conditions of distribution and use, see copyright notice in zlib.h    */ diff --git a/lib/libz/example.c b/lib/libz/example.c index 8c8cdfb10eae..362a4a572428 100644 --- a/lib/libz/example.c +++ b/lib/libz/example.c @@ -1,5 +1,5 @@  /* example.c -- usage example of the zlib compression library - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly.   * For conditions of distribution and use, see copyright notice in zlib.h    */ diff --git a/lib/libz/gzio.c b/lib/libz/gzio.c index abefdc72d229..99e6c2a4d49d 100644 --- a/lib/libz/gzio.c +++ b/lib/libz/gzio.c @@ -1,5 +1,5 @@  /* gzio.c -- IO on .gz files - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly.   * For conditions of distribution and use, see copyright notice in zlib.h   *   * Compile this file with -DNO_DEFLATE to avoid the compression code. diff --git a/lib/libz/infblock.c b/lib/libz/infblock.c index f2cd3c96123d..ac10995ac82f 100644 --- a/lib/libz/infblock.c +++ b/lib/libz/infblock.c @@ -1,5 +1,5 @@  /* infblock.c -- interpret and process block types to last block - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler   * For conditions of distribution and use, see copyright notice in zlib.h    */ @@ -253,10 +253,11 @@ int r;        if (t != Z_OK)        {          r = t; -        if (r == Z_DATA_ERROR) { +        if (r == Z_DATA_ERROR) +        {            ZFREE(z, s->sub.trees.blens);            s->mode = BAD; -	} +        }          LEAVE        }        s->sub.trees.index = 0; @@ -319,10 +320,11 @@ int r;                                    s->hufts, z);          if (t != Z_OK)          { -          if (t == (uInt)Z_DATA_ERROR) { +          if (t == (uInt)Z_DATA_ERROR) +          {              ZFREE(z, s->sub.trees.blens);              s->mode = BAD; -	} +          }            r = t;            LEAVE          } diff --git a/lib/libz/infcodes.c b/lib/libz/infcodes.c index 7711cf8c92d5..7c5073bc86ea 100644 --- a/lib/libz/infcodes.c +++ b/lib/libz/infcodes.c @@ -1,5 +1,5 @@  /* infcodes.c -- process literals and length/distance pairs - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler   * For conditions of distribution and use, see copyright notice in zlib.h    */ @@ -199,15 +199,9 @@ int r;        Tracevv((stderr, "inflate:         distance %u\n", c->sub.copy.dist));        c->mode = COPY;      case COPY:          /* o: copying bytes in window, waiting for space */ -#ifndef __TURBOC__ /* Turbo C bug for following expression */ -      f = (uInt)(q - s->window) < c->sub.copy.dist ? -          s->end - (c->sub.copy.dist - (q - s->window)) : -          q - c->sub.copy.dist; -#else        f = q - c->sub.copy.dist; -      if ((uInt)(q - s->window) < c->sub.copy.dist) -        f = s->end - (c->sub.copy.dist - (uInt)(q - s->window)); -#endif +      while (f < s->window)             /* modulo window size-"while" instead */ +        f += s->end - s->window;        /* of "if" handles invalid distances */        while (c->len)        {          NEEDOUT diff --git a/lib/libz/inffast.c b/lib/libz/inffast.c index 0f1471a927c5..b491dfb71e95 100644 --- a/lib/libz/inffast.c +++ b/lib/libz/inffast.c @@ -1,5 +1,5 @@  /* inffast.c -- process literals and length/distance pairs fast - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler   * For conditions of distribution and use, see copyright notice in zlib.h    */ @@ -96,28 +96,41 @@ z_streamp z;              /* do the copy */              m -= c; -            if ((uInt)(q - s->window) >= d)     /* offset before dest */ -            {                                   /*  just copy */ -              r = q - d; -              *q++ = *r++;  c--;        /* minimum count is three, */ -              *q++ = *r++;  c--;        /*  so unroll loop a little */ -            } -            else                        /* else offset after destination */ +            r = q - d; +            if (r < s->window)                  /* wrap if needed */              { -              e = d - (uInt)(q - s->window); /* bytes from offset to end */ -              r = s->end - e;           /* pointer to offset */ -              if (c > e)                /* if source crosses, */ +              do { +                r += s->end - s->window;        /* force pointer in window */ +              } while (r < s->window);          /* covers invalid distances */ +              e = s->end - r; +              if (c > e)                { -                c -= e;                 /* copy to end of window */ +                c -= e;                         /* wrapped copy */                  do { -                  *q++ = *r++; +                    *q++ = *r++;                  } while (--e); -                r = s->window;          /* copy rest from start of window */ +                r = s->window; +                do { +                    *q++ = *r++; +                } while (--c);                } +              else                              /* normal copy */ +              { +                *q++ = *r++;  c--; +                *q++ = *r++;  c--; +                do { +                    *q++ = *r++; +                } while (--c); +              } +            } +            else                                /* normal copy */ +            { +              *q++ = *r++;  c--; +              *q++ = *r++;  c--; +              do { +                *q++ = *r++; +              } while (--c);              } -            do {                        /* copy all or what's left */ -              *q++ = *r++; -            } while (--c);              break;            }            else if ((e & 64) == 0) diff --git a/lib/libz/inflate.c b/lib/libz/inflate.c index 565a64cb0fd2..b89e768a71c4 100644 --- a/lib/libz/inflate.c +++ b/lib/libz/inflate.c @@ -1,5 +1,5 @@  /* inflate.c -- zlib interface to inflate modules - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler   * For conditions of distribution and use, see copyright notice in zlib.h    */ diff --git a/lib/libz/inftrees.c b/lib/libz/inftrees.c index 9ed0316bb574..912fb9c68b69 100644 --- a/lib/libz/inftrees.c +++ b/lib/libz/inftrees.c @@ -1,5 +1,5 @@  /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler   * For conditions of distribution and use, see copyright notice in zlib.h    */ @@ -14,7 +14,7 @@ __FBSDID("$FreeBSD$");  #endif  const char inflate_copyright[] = -   " inflate 1.1.3 Copyright 1995-1998 Mark Adler "; +   " inflate 1.1.4 Copyright 1995-2002 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 @@ -107,8 +107,7 @@ uIntf *v;               /* working area: values in order of bit length */  /* Given a list of code lengths and a maximum table size, make a set of     tables to decode that set of codes.  Return Z_OK on success, Z_BUF_ERROR     if the given code set is incomplete (the tables are still built in this -   case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of -   lengths), or Z_MEM_ERROR if not enough memory. */ +   case), or Z_DATA_ERROR if the input is invalid. */  {    uInt a;                       /* counter for codes of length k */ @@ -234,7 +233,7 @@ uIntf *v;               /* working area: values in order of bit length */          /* allocate new table */          if (*hn + z > MANY)     /* (note: doesn't matter for fixed) */ -          return Z_MEM_ERROR;   /* not enough memory */ +          return Z_DATA_ERROR;  /* overflow of MANY */          u[h] = q = hp + *hn;          *hn += z; diff --git a/lib/libz/infutil.c b/lib/libz/infutil.c index 7461404b6d77..36e14e366139 100644 --- a/lib/libz/infutil.c +++ b/lib/libz/infutil.c @@ -1,5 +1,5 @@  /* inflate_util.c -- data and routines common to blocks and codes - * Copyright (C) 1995-1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler   * For conditions of distribution and use, see copyright notice in zlib.h    */ diff --git a/lib/libz/maketree.c b/lib/libz/maketree.c index 57a35356f8d3..a71af29b977a 100644 --- a/lib/libz/maketree.c +++ b/lib/libz/maketree.c @@ -1,5 +1,5 @@  /* maketree.c -- make inffixed.h table for decoding fixed codes - * Copyright (C) 1998 Mark Adler + * Copyright (C) 1995-2002 Mark Adler   * For conditions of distribution and use, see copyright notice in zlib.h    */ diff --git a/lib/libz/minigzip.c b/lib/libz/minigzip.c index cd7e2de95bd4..888d844dbd1f 100644 --- a/lib/libz/minigzip.c +++ b/lib/libz/minigzip.c @@ -1,5 +1,5 @@  /* minigzip.c -- simulate gzip using the zlib compression library - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly.   * For conditions of distribution and use, see copyright notice in zlib.h    */ diff --git a/lib/libz/trees.c b/lib/libz/trees.c index 116d9f640c8b..dd2a3a0cba8c 100644 --- a/lib/libz/trees.c +++ b/lib/libz/trees.c @@ -1,5 +1,5 @@  /* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-1998 Jean-loup Gailly + * Copyright (C) 1995-2002 Jean-loup Gailly   * For conditions of distribution and use, see copyright notice in zlib.h    */ diff --git a/lib/libz/uncompr.c b/lib/libz/uncompr.c index 18be3b8a2162..0370ac9b71f7 100644 --- a/lib/libz/uncompr.c +++ b/lib/libz/uncompr.c @@ -1,5 +1,5 @@  /* uncompr.c -- decompress a memory buffer - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly.   * For conditions of distribution and use, see copyright notice in zlib.h    */ diff --git a/lib/libz/zconf.h b/lib/libz/zconf.h index a294f58d0560..8e211502e4a9 100644 --- a/lib/libz/zconf.h +++ b/lib/libz/zconf.h @@ -1,5 +1,5 @@  /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly.   * For conditions of distribution and use, see copyright notice in zlib.h    */ diff --git a/lib/libz/zlib.3 b/lib/libz/zlib.3 index 1c2950932f43..c1d495c1e4c7 100644 --- a/lib/libz/zlib.3 +++ b/lib/libz/zlib.3 @@ -1,6 +1,6 @@  .\" $FreeBSD$  .\" -.TH ZLIB 3 "9 July 1998" +.TH ZLIB 3 "11 March 2002"  .SH NAME  zlib \- compression/decompression library  .SH SYNOPSIS @@ -84,8 +84,8 @@ These documents are also available in other formats from:  .IP  ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html  .SH AUTHORS -Version 1.1.3 -Copyright (C) 1995-1998 Jean-loup Gailly (jloup@gzip.org) +Version 1.1.4 +Copyright (C) 1995-2002 Jean-loup Gailly (jloup@gzip.org)  and Mark Adler (madler@alumni.caltech.edu).  .LP  This software is provided "as-is," diff --git a/lib/libz/zutil.c b/lib/libz/zutil.c index 64a2a57735ab..46078c7ec48a 100644 --- a/lib/libz/zutil.c +++ b/lib/libz/zutil.c @@ -1,5 +1,5 @@  /* zutil.c -- target dependent utility functions for the compression library - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly.   * For conditions of distribution and use, see copyright notice in zlib.h    */ diff --git a/lib/libz/zutil.h b/lib/libz/zutil.h index 378703d03a54..0423ecd28ba8 100644 --- a/lib/libz/zutil.h +++ b/lib/libz/zutil.h @@ -1,5 +1,5 @@  /* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-1998 Jean-loup Gailly. + * Copyright (C) 1995-2002 Jean-loup Gailly.   * For conditions of distribution and use, see copyright notice in zlib.h   */  | 
