diff options
author | Sebastian Pop <s.pop@samsung.com> | 2019-03-06 14:20:04 -0600 |
---|---|---|
committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2019-03-21 11:22:36 +0100 |
commit | f898fa08e955ef319d8529a2cfa68ae5e046e562 (patch) | |
tree | 3376359819ed2867df14c41ca223485126c3f415 /inflate.c | |
parent | 20ca64fa5d2d8a7421ed86b68709ef971dcfbddf (diff) |
use chunkcopysafe and chunkmemsetsafe under INFFAST_CHUNKSIZE from inflate
Diffstat (limited to 'inflate.c')
-rw-r--r-- | inflate.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1164,18 +1164,26 @@ int ZEXPORT PREFIX(inflate)(PREFIX3(stream) *strm, int flush) { copy = state->length; if (copy > left) copy = left; +#if defined(INFFAST_CHUNKSIZE) + put = chunkcopysafe(put, from, copy, put + left); +#else if (copy >= sizeof(uint64_t)) put = chunk_memcpy(put, from, copy); else put = copy_bytes(put, from, copy); +#endif } else { /* copy from output */ copy = state->length; if (copy > left) copy = left; +#if defined(INFFAST_CHUNKSIZE) + put = chunkmemsetsafe(put, state->offset, copy, left); +#else if (copy >= sizeof(uint64_t)) put = chunk_memset(put, put - state->offset, state->offset, copy); else put = set_bytes(put, put - state->offset, state->offset, copy); +#endif } left -= copy; state->length -= copy; |