From 3be3203e2dcd8da1a830da7710b098f28295deb7 Mon Sep 17 00:00:00 2001 From: kichik Date: Sun, 3 Aug 2003 12:59:25 +0000 Subject: [PATCH] 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 --- Source/zlib/INFBLOCK.C | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/zlib/INFBLOCK.C b/Source/zlib/INFBLOCK.C index f3d4c2bb..ca6896a0 100644 --- a/Source/zlib/INFBLOCK.C +++ b/Source/zlib/INFBLOCK.C @@ -153,7 +153,7 @@ uInt *hn) /* working area: values in order of bit length */ /* Generate counts for each bit length */ p=c; y=16; while (y--) *p++ = 0; - p = b; + p = b; i = n; do { c[*p++]++; /* assume all entries <= BMAX */ @@ -347,7 +347,7 @@ int inflate(z_streamp z) NEEDBITS(3) t = (uInt)b & 7; DUMPBITS(3) - s->last = t & 1 ? DRY : TYPE; + s->last = (t & 1) ? DRY : TYPE; switch (t >> 1) { 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, &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; break; @@ -673,7 +673,7 @@ int inflate(z_streamp z) /* DRY if last, TYPE if not */ s->mode = s->last; if (s->mode == TYPE) - LEAVE(Z_OK) + break; LEAVE(Z_STREAM_END) //case BAD: //r = Z_DATA_ERROR;