Turn large PNG chunks into benign errors

Import Chromium commit
e87a029871

Add the author to the list of libpng contributing authors.

Portions from the original commit message follow:

***

A recent change to libpng [1] (included in Chromium with the recent
libpng update [2]) turns chunks that are bigger than
PNG_USER_CHUNK_MALLOC_MAX into failures. Although this matches the
intent of PNG_USER_CHUNK_MALLOC_MAX, it also causes images which used to
be viewable in Chromium to fail. Changing to a benign error allows us to
display these images once again. Though it means we do allow libpng to
allocate more than PNG_USER_CHUNK_MALLOC_MAX, it matches the behavior
prior to [2] (when we were using 1.6.22), and it does not regress
crbug.com/117369

[1] 347538efbd
[2] f82653a473

***

Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=827754
Co-authored-by: Leon Scroggins III <scroggo@google.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
Cosmin Truta 2022-11-20 00:56:35 +02:00
parent 9b5488054b
commit 33de006e12
2 changed files with 3 additions and 2 deletions

View File

@ -35,9 +35,10 @@ Authors, for copyright and licensing purposes.
* Arm Holdings
- Richard Townsend
* Google Inc.
- Dan Field
- Leon Scroggins III
- Matt Sarett
- Mike Klein
- Dan Field
- Sami Boukortt
The build projects, the build scripts, the test scripts, and other

View File

@ -3186,7 +3186,7 @@ png_check_chunk_length(png_const_structrp png_ptr, png_uint_32 length)
{
png_debug2(0," length = %lu, limit = %lu",
(unsigned long)length,(unsigned long)limit);
png_chunk_error(png_ptr, "chunk data is too large");
png_benign_error(png_ptr, "chunk data is too large");
}
}