summaryrefslogtreecommitdiff
path: root/inflate.c
diff options
context:
space:
mode:
authorSebastian Pop <s.pop@samsung.com>2019-03-06 14:20:04 -0600
committerHans Kristian Rosbach <hk-github@circlestorm.org>2019-03-21 11:22:36 +0100
commitf898fa08e955ef319d8529a2cfa68ae5e046e562 (patch)
tree3376359819ed2867df14c41ca223485126c3f415 /inflate.c
parent20ca64fa5d2d8a7421ed86b68709ef971dcfbddf (diff)
use chunkcopysafe and chunkmemsetsafe under INFFAST_CHUNKSIZE from inflate
Diffstat (limited to 'inflate.c')
-rw-r--r--inflate.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/inflate.c b/inflate.c
index 293081a..6ba7627 100644
--- a/inflate.c
+++ b/inflate.c
@@ -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;