diff options
Diffstat (limited to 'inflate.c')
-rw-r--r-- | inflate.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -180,10 +180,19 @@ int stream_size; | |||
180 | if (strm == Z_NULL) return Z_STREAM_ERROR; | 180 | if (strm == Z_NULL) return Z_STREAM_ERROR; |
181 | strm->msg = Z_NULL; /* in case we return an error */ | 181 | strm->msg = Z_NULL; /* in case we return an error */ |
182 | if (strm->zalloc == (alloc_func)0) { | 182 | if (strm->zalloc == (alloc_func)0) { |
183 | #ifdef Z_SOLO | ||
184 | return Z_STREAM_ERROR; | ||
185 | #else | ||
183 | strm->zalloc = zcalloc; | 186 | strm->zalloc = zcalloc; |
184 | strm->opaque = (voidpf)0; | 187 | strm->opaque = (voidpf)0; |
188 | #endif | ||
185 | } | 189 | } |
186 | if (strm->zfree == (free_func)0) strm->zfree = zcfree; | 190 | if (strm->zfree == (free_func)0) |
191 | #ifdef Z_SOLO | ||
192 | return Z_STREAM_ERROR; | ||
193 | #else | ||
194 | strm->zfree = zcfree; | ||
195 | #endif | ||
187 | state = (struct inflate_state FAR *) | 196 | state = (struct inflate_state FAR *) |
188 | ZALLOC(strm, 1, sizeof(struct inflate_state)); | 197 | ZALLOC(strm, 1, sizeof(struct inflate_state)); |
189 | if (state == Z_NULL) return Z_MEM_ERROR; | 198 | if (state == Z_NULL) return Z_MEM_ERROR; |
@@ -1433,8 +1442,8 @@ z_streamp source; | |||
1433 | } | 1442 | } |
1434 | 1443 | ||
1435 | /* copy state */ | 1444 | /* copy state */ |
1436 | zmemcpy(dest, source, sizeof(z_stream)); | 1445 | zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream)); |
1437 | zmemcpy(copy, state, sizeof(struct inflate_state)); | 1446 | zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state)); |
1438 | if (state->lencode >= state->codes && | 1447 | if (state->lencode >= state->codes && |
1439 | state->lencode <= state->codes + ENOUGH - 1) { | 1448 | state->lencode <= state->codes + ENOUGH - 1) { |
1440 | copy->lencode = copy->codes + (state->lencode - state->codes); | 1449 | copy->lencode = copy->codes + (state->lencode - state->codes); |