Fixed bug #777590 - inflate left too early causing NSIS to think more data is needed thus discarding unused data

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2779 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-08-03 12:59:25 +00:00
parent 95df32d7f4
commit 3be3203e2d

View file

@ -153,7 +153,7 @@ uInt *hn) /* working area: values in order of bit length */
/* Generate counts for each bit length */ /* Generate counts for each bit length */
p=c; p=c;
y=16; while (y--) *p++ = 0; y=16; while (y--) *p++ = 0;
p = b; p = b;
i = n; i = n;
do { do {
c[*p++]++; /* assume all entries <= BMAX */ c[*p++]++; /* assume all entries <= BMAX */
@ -347,7 +347,7 @@ int inflate(z_streamp z)
NEEDBITS(3) NEEDBITS(3)
t = (uInt)b & 7; t = (uInt)b & 7;
DUMPBITS(3) DUMPBITS(3)
s->last = t & 1 ? DRY : TYPE; s->last = (t & 1) ? DRY : TYPE;
switch (t >> 1) switch (t >> 1)
{ {
case 0: /* stored */ case 0: /* stored */
@ -459,7 +459,7 @@ int inflate(z_streamp z)
t = huft_build(s->sub.trees.t_blens, 19, 19, (short *)Z_NULL, (short*)Z_NULL, t = huft_build(s->sub.trees.t_blens, 19, 19, (short *)Z_NULL, (short*)Z_NULL,
&s->sub.trees.tb, &s->sub.trees.bb, s->hufts, &hn); &s->sub.trees.tb, &s->sub.trees.bb, s->hufts, &hn);
if (t != Z_OK || s->sub.trees.bb == 0) if (t != Z_OK || !s->sub.trees.bb)
{ {
s->mode = BAD; s->mode = BAD;
break; break;
@ -673,7 +673,7 @@ int inflate(z_streamp z)
/* DRY if last, TYPE if not */ /* DRY if last, TYPE if not */
s->mode = s->last; s->mode = s->last;
if (s->mode == TYPE) if (s->mode == TYPE)
LEAVE(Z_OK) break;
LEAVE(Z_STREAM_END) LEAVE(Z_STREAM_END)
//case BAD: //case BAD:
//r = Z_DATA_ERROR; //r = Z_DATA_ERROR;