aboutsummaryrefslogtreecommitdiff
path: root/inflate.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:24:43 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:24:43 -0700
commit6b8233bfe00e79134cb1b84fc49d4f750a797f79 (patch)
treeca2b03b0169568681dc3d9c823e9f0bc4417d6b5 /inflate.c
parent0484693e1723bbab791c56f95597bd7dbe867d03 (diff)
downloadzlib-6b8233bfe00e79134cb1b84fc49d4f750a797f79.tar.gz
zlib-6b8233bfe00e79134cb1b84fc49d4f750a797f79.tar.bz2
zlib-6b8233bfe00e79134cb1b84fc49d4f750a797f79.zip
zlib 1.2.2.3v1.2.2.3
Diffstat (limited to 'inflate.c')
-rw-r--r--inflate.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/inflate.c b/inflate.c
index 5733437..7dccc9d 100644
--- a/inflate.c
+++ b/inflate.c
@@ -1,5 +1,5 @@
1/* inflate.c -- zlib decompression 1/* inflate.c -- zlib decompression
2 * Copyright (C) 1995-2004 Mark Adler 2 * Copyright (C) 1995-2005 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h 3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */ 4 */
5 5
@@ -1334,11 +1334,15 @@ z_streamp source;
1334 /* copy state */ 1334 /* copy state */
1335 zmemcpy(dest, source, sizeof(z_stream)); 1335 zmemcpy(dest, source, sizeof(z_stream));
1336 zmemcpy(copy, state, sizeof(struct inflate_state)); 1336 zmemcpy(copy, state, sizeof(struct inflate_state));
1337 copy->lencode = copy->codes + (state->lencode - state->codes); 1337 if (state->lencode >= state->codes &&
1338 copy->distcode = copy->codes + (state->distcode - state->codes); 1338 state->lencode <= state->codes + ENOUGH - 1)
1339 {
1340 copy->lencode = copy->codes + (state->lencode - state->codes);
1341 copy->distcode = copy->codes + (state->distcode - state->codes);
1342 }
1339 copy->next = copy->codes + (state->next - state->codes); 1343 copy->next = copy->codes + (state->next - state->codes);
1340 if (window != Z_NULL) 1344 if (window != Z_NULL)
1341 zmemcpy(window, state->window, 1U << state->wbits); 1345 zmemcpy(window, state->window, (uInt)(1U << state->wbits));
1342 copy->window = window; 1346 copy->window = window;
1343 dest->state = (voidpf)copy; 1347 dest->state = (voidpf)copy;
1344 return Z_OK; 1348 return Z_OK;