Skip to content

Commit 6df121b

Browse files
Update zlib from 1.2.12 to 1.2.13 (#2841)
1 parent 94bab09 commit 6df121b

File tree

18 files changed

+261
-227
lines changed

18 files changed

+261
-227
lines changed

vendor/libpng/pnglibconf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@
209209
#define PNG_USER_HEIGHT_MAX 1000000
210210
#define PNG_USER_WIDTH_MAX 1000000
211211
#define PNG_ZBUF_SIZE 8192
212-
#define PNG_ZLIB_VERNUM 0x12c0 /* this was manually incremented from 0x12b0 by MTA for newer zlib support */
212+
#define PNG_ZLIB_VERNUM 0x12d0 /* this was manually incremented from 0x12c0 by MTA for newer zlib support */
213213
#define PNG_Z_DEFAULT_COMPRESSION (-1)
214214
#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0
215215
#define PNG_Z_DEFAULT_STRATEGY 1

vendor/zlib/compress.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
2020
Z_STREAM_ERROR if the level parameter is invalid.
2121
*/
22-
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
22+
int ZEXPORT compress2(dest, destLen, source, sourceLen, level)
2323
Bytef *dest;
2424
uLongf *destLen;
2525
const Bytef *source;
@@ -65,7 +65,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
6565

6666
/* ===========================================================================
6767
*/
68-
int ZEXPORT compress (dest, destLen, source, sourceLen)
68+
int ZEXPORT compress(dest, destLen, source, sourceLen)
6969
Bytef *dest;
7070
uLongf *destLen;
7171
const Bytef *source;
@@ -78,7 +78,7 @@ int ZEXPORT compress (dest, destLen, source, sourceLen)
7878
If the default memLevel or windowBits for deflateInit() is changed, then
7979
this function needs to be updated.
8080
*/
81-
uLong ZEXPORT compressBound (sourceLen)
81+
uLong ZEXPORT compressBound(sourceLen)
8282
uLong sourceLen;
8383
{
8484
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +

vendor/zlib/crc32.c

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,22 @@
9898
# endif
9999
#endif
100100

101+
/* If available, use the ARM processor CRC32 instruction. */
102+
#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
103+
# define ARMCRC32
104+
#endif
105+
101106
/* Local functions. */
102107
local z_crc_t multmodp OF((z_crc_t a, z_crc_t b));
103108
local z_crc_t x2nmodp OF((z_off64_t n, unsigned k));
104109

105-
/* If available, use the ARM processor CRC32 instruction. */
106-
#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
107-
# define ARMCRC32
110+
#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
111+
local z_word_t byte_swap OF((z_word_t word));
112+
#endif
113+
114+
#if defined(W) && !defined(ARMCRC32)
115+
local z_crc_t crc_word OF((z_word_t data));
116+
local z_word_t crc_word_big OF((z_word_t data));
108117
#endif
109118

110119
#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
@@ -630,7 +639,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
630639
#endif /* DYNAMIC_CRC_TABLE */
631640

632641
/* Pre-condition the CRC */
633-
crc ^= 0xffffffff;
642+
crc = (~crc) & 0xffffffff;
634643

635644
/* Compute the CRC up to a word boundary. */
636645
while (len && ((z_size_t)buf & 7) != 0) {
@@ -645,8 +654,8 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
645654
len &= 7;
646655

647656
/* Do three interleaved CRCs to realize the throughput of one crc32x
648-
instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three
649-
CRCs are combined into a single CRC after each set of batches. */
657+
instruction per cycle. Each CRC is calculated on Z_BATCH words. The
658+
three CRCs are combined into a single CRC after each set of batches. */
650659
while (num >= 3 * Z_BATCH) {
651660
crc1 = 0;
652661
crc2 = 0;
@@ -749,7 +758,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
749758
#endif /* DYNAMIC_CRC_TABLE */
750759

751760
/* Pre-condition the CRC */
752-
crc ^= 0xffffffff;
761+
crc = (~crc) & 0xffffffff;
753762

754763
#ifdef W
755764

@@ -1077,7 +1086,7 @@ uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
10771086
#ifdef DYNAMIC_CRC_TABLE
10781087
once(&made, make_crc_table);
10791088
#endif /* DYNAMIC_CRC_TABLE */
1080-
return multmodp(x2nmodp(len2, 3), crc1) ^ crc2;
1089+
return multmodp(x2nmodp(len2, 3), crc1) ^ (crc2 & 0xffffffff);
10811090
}
10821091

10831092
/* ========================================================================= */
@@ -1086,7 +1095,7 @@ uLong ZEXPORT crc32_combine(crc1, crc2, len2)
10861095
uLong crc2;
10871096
z_off_t len2;
10881097
{
1089-
return crc32_combine64(crc1, crc2, len2);
1098+
return crc32_combine64(crc1, crc2, (z_off64_t)len2);
10901099
}
10911100

10921101
/* ========================================================================= */
@@ -1103,14 +1112,14 @@ uLong ZEXPORT crc32_combine_gen64(len2)
11031112
uLong ZEXPORT crc32_combine_gen(len2)
11041113
z_off_t len2;
11051114
{
1106-
return crc32_combine_gen64(len2);
1115+
return crc32_combine_gen64((z_off64_t)len2);
11071116
}
11081117

11091118
/* ========================================================================= */
1110-
uLong crc32_combine_op(crc1, crc2, op)
1119+
uLong ZEXPORT crc32_combine_op(crc1, crc2, op)
11111120
uLong crc1;
11121121
uLong crc2;
11131122
uLong op;
11141123
{
1115-
return multmodp(op, crc1) ^ crc2;
1124+
return multmodp(op, crc1) ^ (crc2 & 0xffffffff);
11161125
}

0 commit comments

Comments
 (0)