diff options
author | Werner Koch <[email protected]> | 1999-01-13 13:12:50 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 1999-01-13 13:12:50 +0000 |
commit | e99e43cd531c4ba26bb1b2fbc0e356f95126ae24 (patch) | |
tree | f591efcd4d250d73c4b265e29a1e1fa44b889017 /zlib/inffast.c | |
parent | See ChangeLog: Wed Jan 13 12:49:36 CET 1999 Werner Koch (diff) | |
download | gnupg-e99e43cd531c4ba26bb1b2fbc0e356f95126ae24.tar.gz gnupg-e99e43cd531c4ba26bb1b2fbc0e356f95126ae24.zip |
See ChangeLog: Wed Jan 13 14:10:15 CET 1999 Werner Koch
Diffstat (limited to '')
-rw-r--r-- | zlib/inffast.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/zlib/inffast.c b/zlib/inffast.c index 86eee4a29..61a78ee93 100644 --- a/zlib/inffast.c +++ b/zlib/inffast.c @@ -1,5 +1,5 @@ /* inffast.c -- process literals and length/distance pairs fast - * Copyright (C) 1995-1996 Mark Adler + * Copyright (C) 1995-1998 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -13,14 +13,12 @@ struct inflate_codes_state {int dummy;}; /* for buggy compilers */ /* simplify the use of the inflate_huft type with some defines */ -#define base more.Base -#define next more.Next #define exop word.what.Exop #define bits word.what.Bits /* macros for bit input with no checking and for returning unused bytes */ #define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}} -#define UNGRAB {n+=(c=k>>3);p-=c;k&=7;} +#define UNGRAB {c=z->avail_in-n;c=(k>>3)<c?k>>3:c;n+=c;p-=c;k-=c<<3;} /* Called with number of bytes left to write in window at least 258 (the maximum string length) and number of input bytes available @@ -120,7 +118,10 @@ z_streamp z; break; } else if ((e & 64) == 0) - e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop; + { + t += t->base; + e = (t += ((uInt)b & inflate_mask[e]))->exop; + } else { z->msg = (char*)"invalid distance code"; @@ -133,7 +134,8 @@ z_streamp z; } if ((e & 64) == 0) { - if ((e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop) == 0) + t += t->base; + if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0) { DUMPBITS(t->bits) Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ? |