summaryrefslogtreecommitdiff
path: root/patches
AgeCommit message (Collapse)Author
2024-02-21[zlib] Avoid wide writes to dst in crc_fold_copy when len < 16Hans Wennborg
When copying directly to next_out, as is done in deflate_stored, there may not be enough space in the buffer. Fix by jmaaninen, test by me. Bug: 325990053 Change-Id: Ia28d3fac9c2db3f27a23a5fbde399cad323ef40d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5307227 Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1263750} NOKEYCHECK=True GitOrigin-RevId: 67c52873de10c06808c0de985a1e3cb8c3456d7a
2024-01-16[zlib] Update minizip to the latest versionHans Wennborg
This pulls in the latest version from https://github.com/madler/zlib/tree/develop/contrib/minizip and applies (and updates) our .patch files. One behavior change is that this enables minizip to open empty zip files (where the End of Central Directory Record occurs at offset zero). Bug: 1517633 Change-Id: Ifdb55795b5326f064f6b05be8af8d39bdae91058 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5190344 Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Reviewed-by: Daniel Rubery <drubery@chromium.org> Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com> Commit-Queue: Hans Wennborg <hans@chromium.org> Cr-Commit-Position: refs/heads/main@{#1247614} NOKEYCHECK=True GitOrigin-RevId: 0e347be5e0a1af5eb0120ebe30865f0c9cb29f7c
2024-01-11[zlib] Add missing .patch files for diffs against upstream minizipHans Wennborg
To make sure we don't lose them in future updates, add missing .patch files for local modifications to minizip. Bug: 1517633, 812400 Change-Id: I227106eb93009a300ceede557b1827e60920899b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5185350 Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1246092} NOKEYCHECK=True GitOrigin-RevId: 350c672ef5f3a6d2361f6e8d9df3bebedfc91a0c
2023-07-29[zlib][arm] Perform CPU feature detection for Arm inside adler32()Ho Cheung
Perform CPU feature detection for Arm within adler32() to have the same behavior as x86. Bug: 1320594 Change-Id: I27c2331840ca40fb58abc2a2b70e0f275aba5900 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4721129 Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1176975} NOKEYCHECK=True GitOrigin-RevId: d55bab3c6484bdb5e84e3b47c629897aed259d35
2023-07-21[mini_zip][build] Use relative paths for minizipAdenilson Cavalcanti
This change allows to build minizip helper tool outside of a Chromium checkout. Bug: 1381000 Change-Id: Ibcc1e9bd90164a64e59e59d660157056ab95916f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4683912 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Sylvain Defresne <sdefresne@chromium.org> Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1173625} NOKEYCHECK=True GitOrigin-RevId: 38a10b9f49f56797b81af733fccde424cb1fd1a0
2023-05-25Add open64 for Large File System support to gzlib.Ramin Halavati
The convention of large file support is passing 3 build flags -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE. Then we can expect open(), lseek(), fopen(), etc. calls to be defined as the LFS-enabled counterparts like open64(), fopen64(). zlib doesn't follow the convention of large file support on Linux and undefines the build flag -D_FILE_OFFSET_BITS=64 in gzguts.h included by gzlib.c. We decide to have a local fix in gzlib.c without an intrusive fix to gzguts.h. This looks to be fine because lseek64 is handled similarly. Bug: 1445975 Change-Id: I5ebed3a51ca106a5d0355d5b882fc2a2d48e7368 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4543405 Auto-Submit: Ramin Halavati <rhalavati@chromium.org> Commit-Queue: Ramin Halavati <rhalavati@chromium.org> Reviewed-by: Leon Scroggins <scroggo@google.com> Reviewed-by: Chris Blume <cblume@chromium.org> Cr-Commit-Position: refs/heads/main@{#1149090} NOKEYCHECK=True GitOrigin-RevId: a2f004437541e1e36c0f2e67d3d4381f4294c592
2023-04-03[zlib][x86] Implement AVX-512 based CRC-32 checksumLei A Shi
This patch will add an AVX-512 based implementation of CRC-32, allowing to achieve higher speeds than the SSE4.2 implementation on newer Intel processors. It enables multiple folding operations providing a boost of ~3.5x faster checksums, thus yielding an average gain of ~3.7% in data decompression. Bug: 1381000 Change-Id: I4f6bb813d1a889f451eb7433581f5d98b6644490 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4374529 Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1125794} NOKEYCHECK=True GitOrigin-RevId: 71774699ed1905a70f5f98375613b012781c880c
2023-01-27[zlib][build] Handle CentOS quirksAdenilson Cavalcanti
Apparently some environments (e.g. CentOS) require to explicitly link with libpthread otherwise build/link of zlib works fine but zlib_bench linking fails. Bug: 1381000 Change-Id: Idfc1984dc096672255bf43f141572c222147f681 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4198473 Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Reviewed-by: Noel Gordon <noel@chromium.org> Reviewed-by: Hans Wennborg <hans@chromium.org> Cr-Commit-Position: refs/heads/main@{#1097968} NOKEYCHECK=True GitOrigin-RevId: 767a83e626f09cf18013e88453514c692442dceb
2023-01-26[zlib][build] Add basic CMake buildsystemAdenilson Cavalcanti
Currently Chromium zlib builds using GN and requires build scripts coming from Chromium source tree (a huge source code checkout). The idea is to allow to build standalone so no need for a full checkout plus permit to actually replace the default system zlib in a Linux system by Chromium zlib. To checkout and build: a) git clone https://chromium.googlesource.com/chromium/src/third_party/zlib/ chromium-zlib b) cd chromium-zlib && mkdir build && cd build c) cmake -DENABLE_SIMD_OPTIMIZATIONS=1 -DCMAKE_BUILD_TYPE=RELEASE .. d) make -j e) sudo make install A regular app linked with the system zlib will immediately benefit if chromium zlib is installed with no need to relink as long it is a match for zlib version (latest release is 1.2.13). On Ubuntu 22.04 using system zlib 1.2.13, and zlib_bench built with: g++ -std=c++14 -O3 ../contrib/bench/zlib_bench.cc $(pkg-config --cflags --libs zlib) a) System zlib: adenilson@hp:~/chromium/src/third_party/zlib/out$ ldd ./a.out | grep libz libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f24845db000) adenilson@hp:~/chromium/src/third_party/zlib/out$ ./a.out gzip ~/corpus/flex/* /home/adenilson/corpus/flex/baddata1.snappy : GZIP: [b 1M] bytes 27512 -> 22920 83.31% comp 52.7 ( 52.8) MB/s uncomp 207.4 (207.9) MB/s /home/adenilson/corpus/flex/geo.protodata : GZIP: [b 1M] bytes 118588 -> 15143 12.77% comp 118.8 (120.1) MB/s uncomp 635.2 (640.6) MB/s /home/adenilson/corpus/flex/html_x_4 : GZIP: [b 1M] bytes 409600 -> 53299 13.01% comp 82.7 ( 83.0) MB/s uncomp 568.4 (569.5) MB/s Now after installing Chromium zlib (no need for rebuild or relink): b) Chromium zlib: adenilson@hp:~/chromium/src/third_party/zlib/out$ ldd ./a.out | grep libz libz.so.1 => /usr/local/lib/libz.so.1 (0x00007f585ef13000) adenilson@hp:~/chromium/src/third_party/zlib/out$ ./a.out gzip ~/corpus/flex/* /home/adenilson/corpus/flex/baddata1.snappy : GZIP: [b 1M] bytes 27512 -> 22920 83.31% comp 61.8 ( 61.9) MB/s uncomp 428.0 (430.3) MB/s /home/adenilson/corpus/flex/geo.protodata : GZIP: [b 1M] bytes 118588 -> 15124 12.75% comp 150.8 (151.4) MB/s uncomp 2121.2 (2135.2) MB/s /home/adenilson/corpus/flex/html_x_4 : GZIP: [b 1M] bytes 409600 -> 53285 13.01% comp 102.5 (103.2) MB/s uncomp 1331.6 (1347.5) MB/s Bug: 1381000 Change-Id: I6a7346076252802a3c866c56e561ebcf5905ccc9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4192965 Reviewed-by: Hans Wennborg <hans@chromium.org> Reviewed-by: Chris Blume <cblume@chromium.org> Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1097405} NOKEYCHECK=True GitOrigin-RevId: 4b596aee1626fe595a13c50366ff59b0aad84f61
2022-03-23Fix out-of-bounds in infcover tests.Florian Mayer
Upstream zlib pull request: https://github.com/madler/zlib/pull/602 Bug: 225069280 Change-Id: I548a836096323053af225083916893b851532980 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3546708 Reviewed-by: Noel Gordon <noel@chromium.org> Commit-Queue: Noel Gordon <noel@chromium.org> Cr-Commit-Position: refs/heads/main@{#984579} NOKEYCHECK=True GitOrigin-RevId: afa134512eec0ab985c64bc39e39b0bb5212f8f6
2021-05-26[zlib] Build minizip zip and unzip toolsNoel Gordon
Minizip is a library provided by //third_party/zlib. Its zip and unzip tools can be built in a developer checkout for testing purposes with: autoninja -C out/Release minizip_bin autoninja -C out/Release miniunz_bin Add GN build rules for these files. Patch minizip and miniunz tools so they compile. Add a patch file and minizip.md for usage. On Android, disable large file support (see bug comment #12). off_t is 32 bits (instead of 64 bits) and should compile on the bots where this patch failed compile before [1] and was reverted (CL:2895825). [1] Added CQ android_asan, android_archive_rel_ng try jobs to pre-test that compile works on these waterfall builders. Bug: 1207895 Change-Id: Idbb3414a2c14fc541e31d6eff97859245296003f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2919568 Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Commit-Queue: Noel Gordon <noel@chromium.org> Cr-Commit-Position: refs/heads/master@{#886990} NOKEYCHECK=True GitOrigin-RevId: a45e197d9695de4214f27e4c218b82e256b10d06
2021-05-13Revert "[zlib] Build minizip zip and unzip tools"Maggie Cai
This reverts commit 741c3736b5f1a015a6d34bd8393f3074313b4466. Reason for revert: This CL is the likely cause for the tree closure with build compile failure in https://ci.chromium.org/ui/p/chromium/builders/ci/android-archive-rel/20566/overview. Error message: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8847293948719164656/+/steps/compile/0/stdout Original change's description: > [zlib] Build minizip zip and unzip tools > > Minizip is a library provided by //third_party/zlib. Its zip and unzip > tools can be built in a developer checkout for testing purposes with: > > autoninja -C out/Release minizip_bin > autoninja -C out/Release miniunz_bin > > Add GN build rules for these files. Patch minizip and miniunz tools so > they compile (all bots). Add a patch file and minizip.md for usage. > > Bug: 1207895 > Change-Id: Ia2e1a920445414fed78e14d9195e484f209cf089 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2887385 > Commit-Queue: Noel Gordon <noel@chromium.org> > Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> > Cr-Commit-Position: refs/heads/master@{#882824} Bug: 1207895 Change-Id: Ib6f568de77cc89e537806ad289b985b43fb6d0f2 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2895825 Auto-Submit: Maggie Cai <mxcai@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Maggie Cai <mxcai@chromium.org> Owners-Override: Maggie Cai <mxcai@chromium.org> Cr-Commit-Position: refs/heads/master@{#882835} NOKEYCHECK=True GitOrigin-RevId: 5bd6329bd2b2e935283a9ed9d61126b5e2c3774a
2021-05-13[zlib] Build minizip zip and unzip toolsNoel Gordon
Minizip is a library provided by //third_party/zlib. Its zip and unzip tools can be built in a developer checkout for testing purposes with: autoninja -C out/Release minizip_bin autoninja -C out/Release miniunz_bin Add GN build rules for these files. Patch minizip and miniunz tools so they compile (all bots). Add a patch file and minizip.md for usage. Bug: 1207895 Change-Id: Ia2e1a920445414fed78e14d9195e484f209cf089 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2887385 Commit-Queue: Noel Gordon <noel@chromium.org> Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Commit-Position: refs/heads/master@{#882824} NOKEYCHECK=True GitOrigin-RevId: 741c3736b5f1a015a6d34bd8393f3074313b4466
2020-11-03[zlib] Zero-initialize the window used for deflationHans Wennborg
Otherwise MSan complains about use-of-uninitialized values in the window. This happens in both regular deflate's longest_match and deflate_rle. Before crrev.com/822755 we used to suppress those reports, but it seems better to fix it properly. That will also allow us to catch other potential issues with MSan in these functions. The instances of this that we've seen only reproduce with fill_window_sse(), not with the regular fill_window() function. Since the former doesn't exist in upstream zlib, I'm not planning to send this patch upstream. Bug: 1137613, 1144420 Change-Id: I2b1801cd2a63fef48a0072b2d2c8fc1f8a7bb920 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2517520 Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Reviewed-by: Chris Blume <cblume@chromium.org> Cr-Commit-Position: refs/heads/master@{#823845} GitOrigin-RevId: 962cbbe81708214ff8e14e2bc8a07271cb15f1b9
2020-09-24[zlib] Avoid crashing in check_match when prev_match == -1Hans Wennborg
prev_match can be set to -1 after sliding the window. In that case, the window has slid past the first byte of the last match, which means it cannot be compared in check_match. This would cause zlib to crash on some inputs to deflate when built with ZLIB_DEBUG enabled. Check for this situation and avoid crashing by not trying to compare the first byte. Bug: 1113142 Change-Id: I26f006d81b91591e07fb02207e64b8440f7a5c50 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2426443 Commit-Queue: Hans Wennborg <hans@chromium.org> Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Commit-Position: refs/heads/master@{#810195} GitOrigin-RevId: c1560c99950947946ff9b5d5978f70bc975ab3af
2020-06-12Fix missing relative include path on utestsAdenilson Cavalcanti
This change will fix an include path that was missing to allow building zlib's unit tests outside of Chromium tree. Bug: 1032721 Change-Id: I9b4e4a0b816e716b7e1cda9172544d02127f0d32 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2242125 Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Reviewed-by: Chris Blume <cblume@chromium.org> Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#777690} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: ea5c8e29bd38461168d12eb1c6c7b5312a7c56db
2020-04-29[zlib] Re-land import canonical zlib inflate cover testsAdenilson Cavalcanti
There is a test suite in Canonical zlib that ensures correctness and coverage of inflate/deflate: the inflate cover (infcover.c) suite. This patch imports the inflate cover suite with the necessary changes to make it build and run under Chromes's C++11 GTEST test system. There are minimal changes (i.e. undefined 'local', miscellaneous C casts to use C++ casts, etc) so we can build it as C++ code and hook into GTEST e.g. use EXPECT_TRUE instead of C assert from <assert.h>. Adds a patch file for these changes, that can be applied on Canonical infcover should we need to sync with a new Canonical zlib release. TODO: there's one test accessing a symbol that causes link errors so comment that code out for now. Bug: 1032721 Change-Id: I004a1357d46d909ad3a5a5bacc5f9ab9bfcb7809 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2168792 Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Reviewed-by: Noel Gordon <noel@chromium.org> Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#763696} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 26b3182d7a40f33da10a95bc69199af925dedbcc
2020-04-22Revert "[zlib] Import canonical zlib inflate cover tests"Collin Baker
This reverts commit 591bbce5ef7136253ac799078a51aac60553e578. Reason for revert: compile failure: https://ci.chromium.org/p/chromium/builders/ci/win32-archive-rel/12393 Original change's description: > [zlib] Import canonical zlib inflate cover tests > > There is a test suite in Canonical zlib that ensures correctness and > coverage of inflate/deflate: the inflate cover (infcover.c) suite. > > This patch imports the inflate cover suite with the necessary changes > to make it build and run under Chromes's C++11 GTEST test system. > > There are minimal changes (i.e. undefined 'local', miscellaneous C > casts to use C++ casts, etc) so we can build it as C++ code and hook > into GTEST e.g. use EXPECT_TRUE instead of C assert from <assert.h>. > > Adds a patch file for these changes, that can be applied on Canonical > infcover should we need to sync with a new Canonical zlib release. > > TODO: there's one test accessing a symbol that causes link errors so > comment that code out for now. > > Bug: 1032721 > Change-Id: I2e7699477025b9eb291d51a713b34a843f1c1116 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2159700 > Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> > Reviewed-by: Noel Gordon <noel@chromium.org> > Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> > Cr-Commit-Position: refs/heads/master@{#761646} TBR=noel@chromium.org,cavalcantii@chromium.org,cblume@chromium.org,adenilson.cavalcanti@arm.com Change-Id: I4eea478017f0408356ffbfd96481337875905839 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 1032721 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2161363 Reviewed-by: Collin Baker <collinbaker@chromium.org> Commit-Queue: Collin Baker <collinbaker@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#761658} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: f2aa05346c32294a6fd523372e1eafa4a8e17a02
2020-04-22[zlib] Import canonical zlib inflate cover testsAdenilson Cavalcanti
There is a test suite in Canonical zlib that ensures correctness and coverage of inflate/deflate: the inflate cover (infcover.c) suite. This patch imports the inflate cover suite with the necessary changes to make it build and run under Chromes's C++11 GTEST test system. There are minimal changes (i.e. undefined 'local', miscellaneous C casts to use C++ casts, etc) so we can build it as C++ code and hook into GTEST e.g. use EXPECT_TRUE instead of C assert from <assert.h>. Adds a patch file for these changes, that can be applied on Canonical infcover should we need to sync with a new Canonical zlib release. TODO: there's one test accessing a symbol that causes link errors so comment that code out for now. Bug: 1032721 Change-Id: I2e7699477025b9eb291d51a713b34a843f1c1116 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2159700 Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Reviewed-by: Noel Gordon <noel@chromium.org> Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#761646} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 591bbce5ef7136253ac799078a51aac60553e578
2020-03-16Fix zlib build on UWP.Jamie Madill
Uses the recommended check for WINAPI_FAMILY instead of outdated code. If this patch sticks and is stable I'll submit a pull request to the official zlib repo. Bug: 1061905 Change-Id: I48fa8c884e8f78bbf890cc7f41ac610395833fff Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2105453 Reviewed-by: Chris Blume <cblume@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#750639} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 1f7282c9d4f987f8e4300562688e722829e344e5
2020-01-23Using zmemzero to initialize deflate_stateAdenilson Cavalcanti
Due to its history, zlib has to support building for environments without access to basic C functions (e.g. memcpy, memset, etc) or in environments with odd memory management patterns (e.g. MSDOS). Therefore, it is good form to use zmemset/zmemcpy/etc for handling memory and the same applies for initializing a memory block to zero. Bug: 1032721 Change-Id: I8d898872ca00197cc7e961d7c49e1912073895c2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2016772 Reviewed-by: Chris Blume <cblume@chromium.org> Reviewed-by: vikas soni <vikassoni@chromium.org> Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#734686} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: bcdbc75cd3f832ad0527a00f5bf56aa437abf1f6
2020-01-23Properly initialize deflate_state instanceAdenilson Cavalcanti
Fix use of uninitialized memory reported by oss-fuzz (and confirmed by valgrind@aarch64) by properly setting deflate_state internal member (i.e. s->prev) to a valid value before use. For details, see: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11360 Bug: 1032721 Change-Id: I6c7b2e87e81b8ccc6c39298fd3c704befd797b96 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2015667 Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Reviewed-by: Chris Blume <cblume@chromium.org> Reviewed-by: vikas soni <vikassoni@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#734278} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 2d43e0d3369904d881e8519a69481226bba3394c
2019-07-25Make chromeconf.h use opt-out instead of opt-in.Nico Weber
Code in src.git generally shouldn't be depended on by clients outside of src.git, so that we're able to atomically change it, and so that we're able to test changes in src.git with the CQ. See also discussion on https://chromium-review.googlesource.com/c/chromium/src/+/1648737 Prerequisite for https://chromium-review.googlesource.com/c/chromium/src/+/1715975 No behavior change for Chromium. Bug: 961769 Change-Id: I69e873528afc2c735b8fa28090449daae43853bb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1718785 Commit-Queue: Nico Weber <thakis@chromium.org> Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Auto-Submit: Nico Weber <thakis@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#680934} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 8efa4bab6c481bb52ca2ae9f53fab2d9734f2f6e
2019-07-19Avoid 'internal_state' macro pollution from zlib.h.Darin Fisher
This ends up conflicting with use of 'internal_state' as a member function name in mojo header files. It creates problems especially with jumbo builds. Fixing it here rather than just working around it in the jumbo build helps avoid others from stumbling over this in the future (especially as we start utilizing mojo more). Change-Id: I649fd80eb80c57e445b78819e9dc674adbf901bd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1709871 Commit-Queue: Darin Fisher <darin@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#679268} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: c56fa983a92c26a87fdf36027cc03a19edd9c157
2019-04-08Make //third_party/zlib a componentTom Anderson
//third_party/zlib currently gets duplicated in 418 DSOs when building 'all'. This CL makes zlib a component so that component builds are a bit smaller/faster. Also rename zlib/names.h to zlib/chromeconf.h and remove it from patch files. BUG=941663 R=thakis Change-Id: I520d7ed30d0cfc322ebf1b9fb31bfbf5469f0209 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1545510 Commit-Queue: Thomas Anderson <thomasanderson@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Auto-Submit: Thomas Anderson <thomasanderson@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#648854} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: d7ee2f99fc936f2162a65b9bf087af94646248e8
2018-02-11Remove zlib/patches/0004-neon-inffast.patchNoel Gordon
Patch files are no longer needed per the patch/README guidelines. Bug: 697280 Change-Id: I975a99ac0de50eb7c61a037c458853dc6406ff69 Reviewed-on: https://chromium-review.googlesource.com/912908 Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Commit-Queue: Noel Gordon <noel@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#536012} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 1dd116fcf2bba4520c2e5603485d95a0141bf51d
2018-02-10Delete zlib/patches/0005-adler32-simd.patchNoel Gordon
Patches are no longer a thing. Remove the patch file for alder32 SIMD change since it mostly touched files that are not part of upstream. One upstream file adler32.c was touched but it has feature guards, so we should be good when merging in any upstream changes. Bug: 762564 Change-Id: Iad8e389667189300fa180755bc2ddc0187138bc0 Reviewed-on: https://chromium-review.googlesource.com/910539 Reviewed-by: Chris Blume <cblume@chromium.org> Commit-Queue: Noel Gordon <noel@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#535922} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 9749d6d75c1703adaf154c8bd37c46d13ad4423a
2018-02-10Remove zlib/patches/0003-use-defines-for-inffast.patchNoel Gordon
Patch files are no longer needed per the README.chromium guidelines. Bug: 764431 Change-Id: I7cbfb9e51f74a7499697e6ff541bb02e30572c5b Reviewed-on: https://chromium-review.googlesource.com/910870 Reviewed-by: Chris Blume <cblume@chromium.org> Commit-Queue: Noel Gordon <noel@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#535919} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: f53ef9e9a51e6b4d16e50ff6533d3761cacb868e
2018-02-06Clarify when a .patch file must be generatedChris Blume
The current README is unclear about when a .patch file must be generated and how we intend to isolate our changes from upstream changes. This patch clarifies how someone can contribute to third_party/zlib while minimizing risk of conflicts with upstream changes. BUG=807488 Change-Id: Iaa503b94f110cb83febbdd8d57527d606d3eb779 Reviewed-on: https://chromium-review.googlesource.com/894856 Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Chris Blume <cblume@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#534751} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 1511a018f9fecad9c4c873b19156ad74d6c64eee
2018-01-11Avoid exporting read_buf renaming from zlibDaniel Bratell
zlib.h includes a macro that renames read_buf->Cr_z_read_buf. Since read_buf is a common name in other parts of the code, it causes some random confusion depending on whether zlib.h has been included or not. The renaming macro is a side effect of the 0001-simd.patch that exposes an internal read_buf method to other files in zlib. This patch renames read_buf as it is exposed so that it has the less common name deflate_read_buf. Bug: 799448 Change-Id: Icdc4eba973891dfd28d82017415048eded62d577 Reviewed-on: https://chromium-review.googlesource.com/852257 Commit-Queue: Daniel Bratell <bratell@opera.com> Reviewed-by: Chris Blume <cblume@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#528512} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 2c709d38a1c6f812da205c03f5448fe4ac5679f3
2017-09-29zlib adler_simd.cNoel Gordon
Add SSSE3 implementation of the adler32 checksum, suitable for both large workloads, and small workloads commonly seen during PNG image decoding. Add a NEON implementation. Speed is comparable to the serial adler32 computation but near 64 bytes of input data, the SIMD code paths begin to be faster than the serial path: 3x faster at 256 bytes of input data, to ~8x faster for 1M of input data (~4x on ARMv8 NEON). For the PNG 140 image corpus, PNG decoding speed is ~8% faster on average on the desktop machines tested, and ~2% on an ARMv8 Pixel C Android (N) tablet, https://crbug.com/762564#c41 Update x86.{c,h} to runtime detect SSSE3 support and use it to enable the adler32_simd code path and update inflate.c to call x86_check_features(). Update the name mangler file names.h for the new symbols added, add FIXME about simd.patch. Ignore data alignment in the SSSE3 case since unaligned access is no longer penalized on current generation Intel CPU. Use it in the NEON case however to avoid the extra costs of unaligned memory access on ARMv8/v7. NEON credits: the v_s1/s2 vector component accumulate code was provided by Adenilson Cavalcanti. The uint16 column vector sum code is from libdeflate with corrections to process NMAX input bytes which improves performance by 3% for large buffers. Update BUILD.gn to put the code in its own source set, and add it conditionally to the zlib library build rule. On ARM, build the SIMD with max-speed config to produce the smallest code. No change in behavior, covered by many existing tests. Bug: 762564 Change-Id: I14a39940ae113b5a67ba70a99c3741e289b1796b Reviewed-on: https://chromium-review.googlesource.com/660019 Commit-Queue: Chris Blume <cblume@chromium.org> Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Reviewed-by: Chris Blume <cblume@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#505447} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 09b784fd12f255a9da38107ac6e0386f4dde6d68
2017-09-29zlib: inflate using wider loads and storesAdenilson Cavalcanti
In inflate_fast() the output pointer always has plenty of room to write. This means that so long as the target is capable, wide un-aligned loads and stores can be used to transfer several bytes at once. When the reference distance is too short simply unroll the data a little to increase the distance. Patch by Simon Hosie. PNG decoding performance gains should be around 30-33%. This also includes the fix reported in madler/zlib#245. Bug: 697280 Change-Id: I90a9866cc56aa766df5de472cd10c007f4b560d8 Reviewed-on: https://chromium-review.googlesource.com/689961 Reviewed-by: Chris Blume <cblume@chromium.org> Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#505276} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 78104f4d73e3bbb4155fa804d00ed66682180556
2017-09-28Zlib patch: prevent uninitialized use of state->checkAdenilson Cavalcanti
No need to call the Adler32 checksum function, just set the struct field to the expected value. Plus some cleanup in the README file (the idea is that this file won't be touched for new patches). Upstream bug: madler/zlib#245 Bug: 697481 Change-Id: Ic495c92c9ca1b5ab8a4d23a8ae29141f4617c091 Reviewed-on: https://chromium-review.googlesource.com/688501 Reviewed-by: Chris Blume <cblume@chromium.org> Commit-Queue: Chris Blume <cblume@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#504897} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: ee376c65abdd5afe787bfb63af9f2e82fdc35c2e
2017-09-21Moving zlib patches to a new folderAdenilson Cavalcanti
The idea is to help avoid constant merge conflicts in new patches on top of Chromium's zlib. Plus adding instructions on how to generate a patch file. Bug: 764094 Change-Id: I90260c7b6514171c4cc927a0299acf82b4ca6c2b Reviewed-on: https://chromium-review.googlesource.com/677495 Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#503523} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: e4fd3cb6f5a3998fef542abb432dc39352708a3c