diff options
author | alk3pInjection <webmaster@raspii.tech> | 2023-04-20 00:08:54 +0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2023-04-20 00:08:54 +0800 |
commit | 004b98220a30de0d1956a8149d8bc6ec356667da (patch) | |
tree | 1eaee2603984d7ab4524be68b57ce0a2b2b72118 /compress.c | |
parent | 2ca0d0b38b60e8d6d49a8959bf674a79e7d16f41 (diff) | |
parent | a583e215afa2356e23b418efa871a1cc4348702a (diff) |
Merge tag '2.0.7' into tachibanatachibana-mr1tachibana
Change-Id: I7b03d60d67d184c21ff7437a35062077666951e9
Diffstat (limited to 'compress.c')
-rw-r--r-- | compress.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -92,6 +92,8 @@ z_size_t Z_EXPORT PREFIX(compressBound)(z_size_t sourceLen) { #ifndef NO_QUICK_STRATEGY return sourceLen /* The source size itself */ + + (sourceLen == 0 ? 1 : 0) /* Always at least one byte for any input */ + + (sourceLen < 9 ? 1 : 0) /* One extra byte for lengths less than 9 */ + DEFLATE_QUICK_OVERHEAD(sourceLen) /* Source encoding overhead, padded to next full byte */ + DEFLATE_BLOCK_OVERHEAD /* Deflate block overhead bytes */ + ZLIB_WRAPLEN; /* zlib wrapper */ |