Skip to content

Commit

Permalink
fixup! Rewrite inflate memory allocation.
Browse files Browse the repository at this point in the history
  • Loading branch information
iii-i committed May 21, 2024
1 parent b611cd3 commit 50b2ff2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,6 @@ int32_t Z_EXPORT PREFIX(inflateCopy)(PREFIX3(stream) *dest, PREFIX3(stream) *sou
if (alloc_bufs == NULL)
return Z_MEM_ERROR;
copy = alloc_bufs->state;
copy->window = alloc_bufs->window;

/* copy state */
memcpy(copy, state, sizeof(struct inflate_state));
Expand All @@ -1416,6 +1415,7 @@ int32_t Z_EXPORT PREFIX(inflateCopy)(PREFIX3(stream) *dest, PREFIX3(stream) *sou
}
copy->next = copy->codes + (state->next - state->codes);
copy->alloc_bufs = alloc_bufs;
copy->window = alloc_bufs->window;

/* window */
ZCOPY_WINDOW(copy->window, state->window, (size_t)state->wsize);
Expand Down

0 comments on commit 50b2ff2

Please sign in to comment.