Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Split code out into separate files and remove some global variables to
[rsync/rsync.git]
/
zlib
/
infblock.c
diff --git
a/zlib/infblock.c
b/zlib/infblock.c
index
f8940c7
..
96a7a26
100644
(file)
--- a/
zlib/infblock.c
+++ b/
zlib/infblock.c
@@
-1,5
+1,5
@@
/* infblock.c -- interpret and process block types to last block
/* 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
*/
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@
-176,7
+176,7
@@
int r;
break;
case 3: /* illegal */
DUMPBITS(3)
break;
case 3: /* illegal */
DUMPBITS(3)
- s->mode = BAD;
+ s->mode =
z
BAD;
z->msg = (char*)"invalid block type";
r = Z_DATA_ERROR;
LEAVE
z->msg = (char*)"invalid block type";
r = Z_DATA_ERROR;
LEAVE
@@
-186,7
+186,7
@@
int r;
NEEDBITS(32)
if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
{
NEEDBITS(32)
if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
{
- s->mode = BAD;
+ s->mode =
z
BAD;
z->msg = (char*)"invalid stored block lengths";
r = Z_DATA_ERROR;
LEAVE
z->msg = (char*)"invalid stored block lengths";
r = Z_DATA_ERROR;
LEAVE
@@
-219,7
+219,7
@@
int r;
#ifndef PKZIP_BUG_WORKAROUND
if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
{
#ifndef PKZIP_BUG_WORKAROUND
if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
{
- s->mode = BAD;
+ s->mode =
z
BAD;
z->msg = (char*)"too many length or distance symbols";
r = Z_DATA_ERROR;
LEAVE
z->msg = (char*)"too many length or distance symbols";
r = Z_DATA_ERROR;
LEAVE
@@
-249,10
+249,12
@@
int r;
&s->sub.trees.tb, s->hufts, z);
if (t != Z_OK)
{
&s->sub.trees.tb, s->hufts, z);
if (t != Z_OK)
{
- ZFREE(z, s->sub.trees.blens);
r = t;
if (r == Z_DATA_ERROR)
r = t;
if (r == Z_DATA_ERROR)
- s->mode = BAD;
+ {
+ ZFREE(z, s->sub.trees.blens);
+ s->mode = zBAD;
+ }
LEAVE
}
s->sub.trees.index = 0;
LEAVE
}
s->sub.trees.index = 0;
@@
-289,7
+291,7
@@
int r;
(c == 16 && i < 1))
{
ZFREE(z, s->sub.trees.blens);
(c == 16 && i < 1))
{
ZFREE(z, s->sub.trees.blens);
- s->mode = BAD;
+ s->mode =
z
BAD;
z->msg = (char*)"invalid bit length repeat";
r = Z_DATA_ERROR;
LEAVE
z->msg = (char*)"invalid bit length repeat";
r = Z_DATA_ERROR;
LEAVE
@@
-313,14
+315,17
@@
int r;
t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
s->sub.trees.blens, &bl, &bd, &tl, &td,
s->hufts, z);
t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
s->sub.trees.blens, &bl, &bd, &tl, &td,
s->hufts, z);
- ZFREE(z, s->sub.trees.blens);
if (t != Z_OK)
{
if (t == (uInt)Z_DATA_ERROR)
if (t != Z_OK)
{
if (t == (uInt)Z_DATA_ERROR)
- s->mode = BAD;
+ {
+ ZFREE(z, s->sub.trees.blens);
+ s->mode = zBAD;
+ }
r = t;
LEAVE
}
r = t;
LEAVE
}
+ ZFREE(z, s->sub.trees.blens);
Tracev((stderr, "inflate: trees ok\n"));
if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
{
Tracev((stderr, "inflate: trees ok\n"));
if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
{
@@
-345,13
+350,6
@@
int r;
s->mode = TYPE;
break;
}
s->mode = TYPE;
break;
}
- if (k > 7) /* return unused byte, if any */
- {
- Assert(k < 16, "inflate_codes grabbed too many bytes")
- k -= 8;
- n++;
- p--; /* can always return one */
- }
s->mode = DRY;
case DRY:
FLUSH
s->mode = DRY;
case DRY:
FLUSH
@@
-361,7
+359,7
@@
int r;
case DONE:
r = Z_STREAM_END;
LEAVE
case DONE:
r = Z_STREAM_END;
LEAVE
- case BAD:
+ case
z
BAD:
r = Z_DATA_ERROR;
LEAVE
default:
r = Z_DATA_ERROR;
LEAVE
default: