Skip to content

Commit 57a38c8

Browse files
nodejs-github-botrichardlau
authored andcommitted
deps: update zlib to 1.3.0.1-motley-dd5fc13
PR-URL: #51105 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]>
1 parent b0ca084 commit 57a38c8

File tree

12 files changed

+85
-20
lines changed

12 files changed

+85
-20
lines changed

deps/zlib/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
33

44
project(zlib C)
55

6-
set(VERSION "1.3")
6+
set(VERSION "1.3.0.1")
77

88
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
99
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")

deps/zlib/README.chromium

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Name: zlib
22
Short Name: zlib
33
URL: http://zlib.net/
4-
Version: 1.2.13
5-
CPEPrefix: cpe:/a:zlib:zlib:1.2.13
4+
Version: 1.3.0.1
5+
CPEPrefix: cpe:/a:zlib:zlib:1.3.0.1
66
Security Critical: yes
77
Shipped: yes
88
License: Zlib

deps/zlib/contrib/minizip/README.chromium

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ License: Zlib
66
License File: //third_party/zlib/LICENSE
77
Security Critical: yes
88
Shipped: yes
9+
CPEPrefix: cpe:/a:minizip_project:minizip
910

1011
Description:
1112
Minizip provides API on top of zlib that can enumerate and extract ZIP archive

deps/zlib/contrib/optimizations/inflate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ int ZEXPORT inflateSync(z_streamp strm) {
14221422
/* if first time, start search in bit buffer */
14231423
if (state->mode != SYNC) {
14241424
state->mode = SYNC;
1425-
state->hold <<= state->bits & 7;
1425+
state->hold >>= state->bits & 7;
14261426
state->bits -= state->bits & 7;
14271427
len = 0;
14281428
while (state->bits >= 8) {

deps/zlib/deflate.c

+22-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
#endif
6666

6767
const char deflate_copyright[] =
68-
" deflate 1.3 Copyright 1995-2023 Jean-loup Gailly and Mark Adler ";
68+
" deflate 1.3.0.1 Copyright 1995-2023 Jean-loup Gailly and Mark Adler ";
6969
/*
7070
If you use the zlib library in a product, an acknowledgment is welcome
7171
in the documentation of your product. If for some reason you cannot
@@ -531,7 +531,11 @@ int ZEXPORT deflateInit2_(z_streamp strm, int level, int method,
531531
* the compressed data for a dynamic block also cannot overwrite the
532532
* symbols from which it is being constructed.
533533
*/
534+
#ifdef LIT_MEM
535+
s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, 5);
536+
#else
534537
s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, 4);
538+
#endif
535539
s->pending_buf_size = (ulg)s->lit_bufsize * 4;
536540

537541
if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
@@ -541,8 +545,14 @@ int ZEXPORT deflateInit2_(z_streamp strm, int level, int method,
541545
deflateEnd (strm);
542546
return Z_MEM_ERROR;
543547
}
548+
#ifdef LIT_MEM
549+
s->d_buf = (ushf *)(s->pending_buf + (s->lit_bufsize << 1));
550+
s->l_buf = s->pending_buf + (s->lit_bufsize << 2);
551+
s->sym_end = s->lit_bufsize - 1;
552+
#else
544553
s->sym_buf = s->pending_buf + s->lit_bufsize;
545554
s->sym_end = (s->lit_bufsize - 1) * 3;
555+
#endif
546556
/* We avoid equality with lit_bufsize*3 because of wraparound at 64K
547557
* on 16 bit machines and because stored blocks are restricted to
548558
* 64K-1 bytes.
@@ -754,9 +764,15 @@ int ZEXPORT deflatePrime(z_streamp strm, int bits, int value) {
754764

755765
if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
756766
s = strm->state;
767+
#ifdef LIT_MEM
768+
if (bits < 0 || bits > 16 ||
769+
(uchf *)s->d_buf < s->pending_out + ((Buf_size + 7) >> 3))
770+
return Z_BUF_ERROR;
771+
#else
757772
if (bits < 0 || bits > 16 ||
758773
s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3))
759774
return Z_BUF_ERROR;
775+
#endif
760776
do {
761777
put = Buf_size - s->bi_valid;
762778
if (put > bits)
@@ -1343,7 +1359,12 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) {
13431359
zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
13441360

13451361
ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
1362+
#ifdef LIT_MEM
1363+
ds->d_buf = (ushf *)(ds->pending_buf + (ds->lit_bufsize << 1));
1364+
ds->l_buf = ds->pending_buf + (ds->lit_bufsize << 2);
1365+
#else
13461366
ds->sym_buf = ds->pending_buf + ds->lit_bufsize;
1367+
#endif
13471368

13481369
ds->l_desc.dyn_tree = ds->dyn_ltree;
13491370
ds->d_desc.dyn_tree = ds->dyn_dtree;

deps/zlib/deflate.h

+30-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
# define GZIP
2424
#endif
2525

26+
/* define LIT_MEM to slightly increase the speed of deflate (order 1% to 2%) at
27+
the cost of a larger memory footprint */
28+
/* #define LIT_MEM */
29+
2630
/* ===========================================================================
2731
* Internal compression state.
2832
*/
@@ -217,7 +221,12 @@ typedef struct internal_state {
217221
/* Depth of each subtree used as tie breaker for trees of equal frequency
218222
*/
219223

224+
#ifdef LIT_MEM
225+
ushf *d_buf; /* buffer for distances */
226+
uchf *l_buf; /* buffer for literals/lengths */
227+
#else
220228
uchf *sym_buf; /* buffer for distances and literals/lengths */
229+
#endif
221230

222231
uInt lit_bufsize;
223232
/* Size of match buffer for literals/lengths. There are 4 reasons for
@@ -239,7 +248,7 @@ typedef struct internal_state {
239248
* - I can't count above 4
240249
*/
241250

242-
uInt sym_next; /* running index in sym_buf */
251+
uInt sym_next; /* running index in symbol buffer */
243252
uInt sym_end; /* symbol table full when sym_next reaches this */
244253

245254
ulg opt_len; /* bit length of current block with optimal trees */
@@ -323,6 +332,25 @@ void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf,
323332
extern const uch ZLIB_INTERNAL _dist_code[];
324333
#endif
325334

335+
#ifdef LIT_MEM
336+
# define _tr_tally_lit(s, c, flush) \
337+
{ uch cc = (c); \
338+
s->d_buf[s->sym_next] = 0; \
339+
s->l_buf[s->sym_next++] = cc; \
340+
s->dyn_ltree[cc].Freq++; \
341+
flush = (s->sym_next == s->sym_end); \
342+
}
343+
# define _tr_tally_dist(s, distance, length, flush) \
344+
{ uch len = (uch)(length); \
345+
ush dist = (ush)(distance); \
346+
s->d_buf[s->sym_next] = dist; \
347+
s->l_buf[s->sym_next++] = len; \
348+
dist--; \
349+
s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
350+
s->dyn_dtree[d_code(dist)].Freq++; \
351+
flush = (s->sym_next == s->sym_end); \
352+
}
353+
#else
326354
# define _tr_tally_lit(s, c, flush) \
327355
{ uch cc = (c); \
328356
s->sym_buf[s->sym_next++] = 0; \
@@ -342,6 +370,7 @@ void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf,
342370
s->dyn_dtree[d_code(dist)].Freq++; \
343371
flush = (s->sym_next == s->sym_end); \
344372
}
373+
#endif
345374
#else
346375
# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
347376
# define _tr_tally_dist(s, distance, length, flush) \

deps/zlib/inflate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ int ZEXPORT inflateSync(z_streamp strm) {
13891389
/* if first time, start search in bit buffer */
13901390
if (state->mode != SYNC) {
13911391
state->mode = SYNC;
1392-
state->hold <<= state->bits & 7;
1392+
state->hold >>= state->bits & 7;
13931393
state->bits -= state->bits & 7;
13941394
len = 0;
13951395
while (state->bits >= 8) {

deps/zlib/inftrees.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#define MAXBITS 15
1010

1111
const char inflate_copyright[] =
12-
" inflate 1.3 Copyright 1995-2023 Mark Adler ";
12+
" inflate 1.3.0.1 Copyright 1995-2023 Mark Adler ";
1313
/*
1414
If you use the zlib library in a product, an acknowledgment is welcome
1515
in the documentation of your product. If for some reason you cannot
@@ -57,7 +57,7 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
5757
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
5858
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
5959
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
60-
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 198, 203};
60+
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 70, 200};
6161
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
6262
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
6363
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,

deps/zlib/trees.c

+16-2
Original file line numberDiff line numberDiff line change
@@ -899,14 +899,19 @@ local void compress_block(deflate_state *s, const ct_data *ltree,
899899
const ct_data *dtree) {
900900
unsigned dist; /* distance of matched string */
901901
int lc; /* match length or unmatched char (if dist == 0) */
902-
unsigned sx = 0; /* running index in sym_buf */
902+
unsigned sx = 0; /* running index in symbol buffers */
903903
unsigned code; /* the code to send */
904904
int extra; /* number of extra bits to send */
905905

906906
if (s->sym_next != 0) do {
907+
#ifdef LIT_MEM
908+
dist = s->d_buf[sx];
909+
lc = s->l_buf[sx++];
910+
#else
907911
dist = s->sym_buf[sx++] & 0xff;
908912
dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8;
909913
lc = s->sym_buf[sx++];
914+
#endif
910915
if (dist == 0) {
911916
send_code(s, lc, ltree); /* send a literal byte */
912917
Tracecv(isgraph(lc), (stderr," '%c' ", lc));
@@ -931,8 +936,12 @@ local void compress_block(deflate_state *s, const ct_data *ltree,
931936
}
932937
} /* literal or match pair ? */
933938

934-
/* Check that the overlay between pending_buf and sym_buf is ok: */
939+
/* Check for no overlay of pending_buf on needed symbols */
940+
#ifdef LIT_MEM
941+
Assert(s->pending < (s->lit_bufsize << 1) + sx, "pendingBuf overflow");
942+
#else
935943
Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
944+
#endif
936945

937946
} while (sx < s->sym_next);
938947

@@ -1082,9 +1091,14 @@ void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf,
10821091
* the current block must be flushed.
10831092
*/
10841093
int ZLIB_INTERNAL _tr_tally(deflate_state *s, unsigned dist, unsigned lc) {
1094+
#ifdef LIT_MEM
1095+
s->d_buf[s->sym_next] = (ush)dist;
1096+
s->l_buf[s->sym_next++] = (uch)lc;
1097+
#else
10851098
s->sym_buf[s->sym_next++] = (uch)dist;
10861099
s->sym_buf[s->sym_next++] = (uch)(dist >> 8);
10871100
s->sym_buf[s->sym_next++] = (uch)lc;
1101+
#endif
10881102
if (dist == 0) {
10891103
/* lc is the unmatched char */
10901104
s->dyn_ltree[lc].Freq++;

deps/zlib/zlib.3

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH ZLIB 3 "xx Oct 2022"
1+
.TH ZLIB 3 "xx Aug 2023"
22
.SH NAME
33
zlib \- compression/decompression library
44
.SH SYNOPSIS
@@ -105,7 +105,7 @@ before asking for help.
105105
Send questions and/or comments to [email protected],
106106
or (for the Windows DLL version) to Gilles Vollant ([email protected]).
107107
.SH AUTHORS AND LICENSE
108-
Version 1.2.13.1
108+
Version 1.2.3.0.1
109109
.LP
110110
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
111111
.LP

deps/zlib/zlib.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* zlib.h -- interface of the 'zlib' general purpose compression library
2-
version 1.3, August 18th, 2023
2+
version 1.3.0.1, August xxth, 2023
33
44
Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler
55
@@ -37,12 +37,12 @@
3737
extern "C" {
3838
#endif
3939

40-
#define ZLIB_VERSION "1.3"
41-
#define ZLIB_VERNUM 0x1300
40+
#define ZLIB_VERSION "1.3.0.1-motley"
41+
#define ZLIB_VERNUM 0x1301
4242
#define ZLIB_VER_MAJOR 1
4343
#define ZLIB_VER_MINOR 3
4444
#define ZLIB_VER_REVISION 0
45-
#define ZLIB_VER_SUBREVISION 0
45+
#define ZLIB_VER_SUBREVISION 1
4646

4747
/*
4848
The 'zlib' compression library provides in-memory compression and

doc/contributing/maintaining/maintaining-dependencies.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This a list of all the dependencies:
3030
* [uv][]
3131
* [uvwasi 0.0.19][]
3232
* [V8][]
33-
* [zlib 1.3-22124f5][]
33+
* [zlib 1.3.0.1-motley-dd5fc13][]
3434

3535
Any code which meets one or more of these conditions should
3636
be managed as a dependency:
@@ -304,7 +304,7 @@ See [maintaining-web-assembly][] for more informations.
304304
high-performance JavaScript and WebAssembly engine, written in C++.
305305
See [maintaining-V8][] for more informations.
306306

307-
### zlib 1.3-22124f5
307+
### zlib 1.3.0.1-motley-dd5fc13
308308

309309
The [zlib](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/zlib)
310310
dependency lossless data-compression library,
@@ -341,4 +341,4 @@ performance improvements not currently available in standard zlib.
341341
[uv]: #uv
342342
[uvwasi 0.0.19]: #uvwasi-0019
343343
[v8]: #v8
344-
[zlib 1.3-22124f5]: #zlib-13-22124f5
344+
[zlib 1.3.0.1-motley-dd5fc13]: #zlib-1301-motley-dd5fc13

0 commit comments

Comments
 (0)