Skip to content

Commit c24b39d

Browse files
authored
Update libpng to 1.6.50 (#4277)
1 parent cc16b62 commit c24b39d

File tree

103 files changed

+4985
-1673
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+4985
-1673
lines changed

Client/core/CFileFormatPng.cpp

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
#include "StdInc.h"
1212
#include <libpng/png.h>
13-
#include <libpng/pngpriv.h>
1413

1514
///////////////////////////////////////////////////////////////
1615
//
@@ -112,7 +111,15 @@ void ParseRGB(CBuffer& outImage, const png_structp& png_ptr, const png_infop& in
112111
///////////////////////////////////////////////////////////////
113112
void ReadDataFromInputStream(png_structp png_ptr, png_bytep outBytes, png_size_t byteCountToRead)
114113
{
115-
CBufferReadStream& stream = *(CBufferReadStream*)png_ptr->io_ptr;
114+
if (!png_ptr)
115+
return;
116+
117+
void* ioPtr = png_get_io_ptr(png_ptr);
118+
119+
if (!ioPtr)
120+
return;
121+
122+
CBufferReadStream& stream = *(CBufferReadStream*)ioPtr;
116123
stream.ReadBytes((byte*)outBytes, (size_t)byteCountToRead);
117124
}
118125

@@ -215,13 +222,19 @@ bool PngDecode(const void* pData, uint uiDataSize, CBuffer* pOutBuffer, uint& ui
215222
///////////////////////////////////////////////////////////////
216223
void my_png_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
217224
{
218-
CBufferWriteStream* pStream = (CBufferWriteStream*)png_ptr->io_ptr;
225+
if (!png_ptr)
226+
return;
227+
228+
void* io_ptr = png_get_io_ptr(png_ptr);
219229

220-
if (!pStream)
230+
if (!io_ptr)
221231
return;
222-
pStream->WriteBytes(data, length);
232+
233+
CBufferWriteStream* stream = (CBufferWriteStream*)io_ptr;
234+
stream->WriteBytes(data, length);
223235
}
224236

237+
225238
///////////////////////////////////////////////////////////////
226239
//
227240
// PngEncode

vendor/libpng/.cmake-format.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ disabled_codes: [
3939
# re-enable the "invalid variable name XXX" messages.
4040
"C0103",
4141

42-
# A custom command with one output doesn't really need a comment because
43-
# the default "generating XXX" is a good message already.
42+
# TODO:
43+
# Add brief COMMENT arguments to the `add_custom_target` commands.
4444
"C0113",
4545
]
4646

@@ -82,10 +82,10 @@ keyword_pattern: "[A-Z][0-9A-Z_]+"
8282
# before considering the loop a parser
8383
max_conditionals_custom_parser: 2
8484

85-
# Require at least this many newlines between statements
85+
# Require at least this many newlines between statements;
86+
# require no more than this many newlines between statements;
87+
# etc.
8688
min_statement_spacing: 1
87-
88-
# Require no more than this many newlines between statements
8989
max_statement_spacing: 2
9090
max_returns: 6
9191
max_branches: 12

vendor/libpng/.editorconfig

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,9 @@
11
# https://editorconfig.org
22

3-
root = true
3+
root = false
44

5-
[*]
6-
charset = utf-8
7-
insert_final_newline = true
8-
trim_trailing_whitespace = true
9-
10-
[*.txt]
11-
indent_size = unset
12-
indent_style = space
13-
14-
[*.[chS]]
15-
indent_size = 3
16-
indent_style = space
17-
max_doc_length = 80
18-
max_line_length = 80
19-
20-
[*.dfa]
21-
indent_size = 3
22-
indent_style = space
23-
max_doc_length = 80
24-
max_line_length = 80
25-
26-
[*.awk]
27-
indent_size = 3
28-
indent_style = space
29-
max_doc_length = 80
30-
max_line_length = 100
31-
32-
[*.cmake]
33-
indent_size = 2
34-
indent_style = space
35-
max_doc_length = 80
36-
max_line_length = 100
37-
38-
[*.sh]
39-
indent_size = 4
40-
indent_style = space
41-
max_doc_length = 100
42-
max_line_length = 100
43-
44-
[{Makefile.in,aclocal.m4,ltmain.sh}]
5+
[*.[ch]]
456
indent_size = unset
467
indent_style = unset
47-
insert_final_newline = unset
488
max_doc_length = unset
499
max_line_length = unset
50-
trim_trailing_whitespace = unset
51-
52-
[COMMIT_EDITMSG]
53-
indent_style = space
54-
max_doc_length = unset
55-
max_line_length = 72

vendor/libpng/.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
restore-keys: ${{ runner.os }}-pip-
2424
- name: Install yamllint
2525
run: pip install yamllint
26+
- name: Install editorconfig-checker
27+
uses: editorconfig-checker/action-editorconfig-checker@main
2628
- name: Check out the code
2729
uses: actions/checkout@v4
2830
- name: Run the linting script

vendor/libpng/.gitignore

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ ipch/
122122
*.out
123123
*out.png
124124
[._]deps/
125+
[._]libs/
125126
.dirstamp
126127
/Makefile
127128
/autom4te.cache/
@@ -138,17 +139,21 @@ ipch/
138139
CMake*.json
139140
!CMakePresets.json
140141
CMakeLists.txt.*
142+
pnglibconf.[ch]
141143
pnglibconf.dfn
142144
pnglibconf.pre
143145
pngprefix.h
144146

145-
# Libpng test programs
146-
png-fix-itxt
147-
pngcp
148-
pngfix
149-
pngimage
150-
pngstest
151-
pngtest
152-
pngunknown
153-
pngvalid
154-
timepng
147+
# Libpng test programs, scripts and artifacts
148+
/test-suite.log
149+
/tests/*.log
150+
/tests/*.trs
151+
/png-fix-itxt
152+
/pngcp
153+
/pngfix
154+
/pngimage
155+
/pngstest
156+
/pngtest
157+
/pngunknown
158+
/pngvalid
159+
/timepng

vendor/libpng/.travis.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

vendor/libpng/ANNOUNCE

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
libpng 1.6.47 - February 18, 2025
2-
=================================
1+
libpng 1.6.50 - July 1, 2025
2+
============================
33

44
This is a public release of libpng, intended for use in production code.
55

@@ -9,13 +9,13 @@ Files available for download
99

1010
Source files with LF line endings (for Unix/Linux):
1111

12-
* libpng-1.6.47.tar.xz (LZMA-compressed, recommended)
13-
* libpng-1.6.47.tar.gz (deflate-compressed)
12+
* libpng-1.6.50.tar.xz (LZMA-compressed, recommended)
13+
* libpng-1.6.50.tar.gz (deflate-compressed)
1414

1515
Source files with CRLF line endings (for Windows):
1616

17-
* lpng1647.7z (LZMA-compressed, recommended)
18-
* lpng1647.zip (deflate-compressed)
17+
* lpng1650.7z (LZMA-compressed, recommended)
18+
* lpng1650.zip (deflate-compressed)
1919

2020
Other information:
2121

@@ -25,19 +25,18 @@ Other information:
2525
* TRADEMARK.md
2626

2727

28-
Changes from version 1.6.46 to version 1.6.47
28+
Changes from version 1.6.49 to version 1.6.50
2929
---------------------------------------------
3030

31-
* Modified the behaviour of colorspace chunks in order to adhere
32-
to the new precedence rules formulated in the latest draft of
33-
the PNG Specification.
31+
* Improved the detection of the RVV Extension on the RISC-V platform.
32+
(Contributed by Filip Wasil)
33+
* Replaced inline ASM with C intrinsics in the RVV code.
34+
(Contributed by Filip Wasil)
35+
* Fixed a decoder defect in which unknown chunks trailing IDAT, set
36+
to go through the unknown chunk handler, incorrectly triggered
37+
out-of-place IEND errors.
3438
(Contributed by John Bowler)
35-
* Fixed a latent bug in `png_write_iCCP`.
36-
This would have been a read-beyond-end-of-malloc vulnerability,
37-
introduced early in the libpng-1.6.0 development, yet (fortunately!)
38-
it was inaccessible before the above-mentioned modification of the
39-
colorspace precedence rules, due to pre-existing colorspace checks.
40-
(Reported by Bob Friesenhahn; fixed by John Bowler)
39+
* Fixed the CMake file for cross-platform builds that require `libm`.
4140

4241

4342
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.

vendor/libpng/AUTHORS

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Authors, for copyright and licensing purposes.
2020
* Lucas Chollet
2121
* Magnus Holmgren
2222
* Mandar Sahastrabuddhe
23+
* Manfred Schlaegl
2324
* Mans Rullgard
2425
* Matt Sarett
2526
* Mike Klein
@@ -40,8 +41,9 @@ Authors, for copyright and licensing purposes.
4041
- Zixu Wang (王子旭)
4142
* Arm Holdings
4243
- Richard Townsend
43-
* Google Inc.
44+
* Google LLC
4445
- Dan Field
46+
- Dragoș Tiselice
4547
- Leon Scroggins III
4648
- Matt Sarett
4749
- Mike Klein
@@ -51,6 +53,8 @@ Authors, for copyright and licensing purposes.
5153
- GuXiWei (顾希伟)
5254
- JinBo (金波)
5355
- ZhangLixia (张利霞)
56+
* Samsung Group
57+
- Filip Wasil
5458

5559
The build projects, the build scripts, the test scripts, and other
5660
files in the "projects", "scripts" and "tests" directories, have

vendor/libpng/CHANGES

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6251,6 +6251,33 @@ Version 1.6.47 [February 18, 2025]
62516251
colorspace precedence rules, due to pre-existing colorspace checks.
62526252
(Reported by Bob Friesenhahn; fixed by John Bowler)
62536253

6254+
Version 1.6.48 [April 30, 2025]
6255+
Fixed the floating-point version of the mDCv setter `png_set_mDCv`.
6256+
(Reported by Mohit Bakshi; fixed by John Bowler)
6257+
Added #error directives to discourage the inclusion of private
6258+
libpng implementation header files in PNG-supporting applications.
6259+
Added the CMake build option `PNG_LIBCONF_HEADER`, to be used as an
6260+
alternative to `DFA_XTRA`.
6261+
Removed the Travis CI configuration files, with heartfelt thanks for
6262+
their generous support of our project over the past five years!
6263+
6264+
Version 1.6.49 [June 12, 2025]
6265+
Added SIMD-optimized code for the RISC-V Vector Extension (RVV).
6266+
(Contributed by Manfred Schlaegl, Dragos Tiselice and Filip Wasil)
6267+
Added various fixes and improvements to the build scripts and to
6268+
the sample code.
6269+
6270+
Version 1.6.50 [July 1, 2025]
6271+
Improved the detection of the RVV Extension on the RISC-V platform.
6272+
(Contributed by Filip Wasil)
6273+
Replaced inline ASM with C intrinsics in the RVV code.
6274+
(Contributed by Filip Wasil)
6275+
Fixed a decoder defect in which unknown chunks trailing IDAT, set
6276+
to go through the unknown chunk handler, incorrectly triggered
6277+
out-of-place IEND errors.
6278+
(Contributed by John Bowler)
6279+
Fixed the CMake file for cross-platform builds that require `libm`.
6280+
62546281
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
62556282
Subscription is required; visit
62566283
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

0 commit comments

Comments
 (0)