aboutsummaryrefslogtreecommitdiff
path: root/inflate.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-12-08 19:03:56 -0800
committerMark Adler <madler@alumni.caltech.edu>2011-12-10 22:33:24 -0800
commit421c7a61f08ff255bf898f0e687b7d7c8fbdae77 (patch)
tree7abc5d3f6fe5120c1afbe468211c10ab9a763901 /inflate.c
parentfb00fda903bbd128952a8ecac4b4f6b459245012 (diff)
downloadzlib-421c7a61f08ff255bf898f0e687b7d7c8fbdae77.tar.gz
zlib-421c7a61f08ff255bf898f0e687b7d7c8fbdae77.tar.bz2
zlib-421c7a61f08ff255bf898f0e687b7d7c8fbdae77.zip
Have inflate() with Z_FINISH avoid the allocation of a window.
inflate() avoided that allocation normally, until it was modified to update the window on a normal completion so that inflateResetKeep() could work. This patch restores that behavior, but only when Z_FINISH is used successfully to complete an inflation of a stream in a single call of inflate(). The comments in zlib.h have been updated accordingly.
Diffstat (limited to 'inflate.c')
-rw-r--r--inflate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/inflate.c b/inflate.c
index 6832b8b..1523598 100644
--- a/inflate.c
+++ b/inflate.c
@@ -1232,7 +1232,8 @@ int flush;
1232 */ 1232 */
1233 inf_leave: 1233 inf_leave:
1234 RESTORE(); 1234 RESTORE();
1235 if (state->wsize || (state->mode < BAD && out != strm->avail_out)) 1235 if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
1236 (state->mode < CHECK || flush != Z_FINISH)))
1236 if (updatewindow(strm, out)) { 1237 if (updatewindow(strm, out)) {
1237 state->mode = MEM; 1238 state->mode = MEM;
1238 return Z_MEM_ERROR; 1239 return Z_MEM_ERROR;