summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2017-09-27 08:19:11 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2017-09-27 08:19:11 -0500
commitcae11e3e43d9ec7cf0c9550c77c10261f119974a (patch)
treeb62de7bdc82638b796fab4049ef0ff942e019a32
parent4f0a0b9a947f45eb87f79b457c50eb6c9fe6a778 (diff)
downloadlibpng-cae11e3e43d9ec7cf0c9550c77c10261f119974a.tar.gz
[libpng16] Treat benign errors as warnings in the libpng fuzzer
-rw-r--r--contrib/oss-fuzz/README.txt2
-rw-r--r--contrib/oss-fuzz/libpng_read_fuzzer.cc5
2 files changed, 5 insertions, 2 deletions
diff --git a/contrib/oss-fuzz/README.txt b/contrib/oss-fuzz/README.txt
index cb7fb13ff..7e1c4c8a5 100644
--- a/contrib/oss-fuzz/README.txt
+++ b/contrib/oss-fuzz/README.txt
@@ -13,7 +13,7 @@ They were licensed by Google Inc, using the BSD-like Chromium license,
which may be found at https://cs.chromium.org/chromium/src/LICENSE, or, if
noted in the source, under the Apache-2.0 license, which may
be found at http://www.apache.org/licenses/LICENSE-2.0 .
-If they have been modified, the derivatives are copyright Glenn Randers-Pehson
+If they have been modified, the derivatives are copyright Glenn Randers-Pehrson
and are released under the same licenses as the originals. Several of
the original files (libpng_read_fuzzer.options, png.dict, project.yaml)
had no licensing information; we assumed that these were under the Chromium
diff --git a/contrib/oss-fuzz/libpng_read_fuzzer.cc b/contrib/oss-fuzz/libpng_read_fuzzer.cc
index 072219b5f..0fc9e206c 100644
--- a/contrib/oss-fuzz/libpng_read_fuzzer.cc
+++ b/contrib/oss-fuzz/libpng_read_fuzzer.cc
@@ -5,7 +5,7 @@
// Use of this source code is governed by a BSD-style license that may
// be found in the LICENSE file https://cs.chromium.org/chromium/src/LICENSE
-// Last changed in libpng 1.6.33beta03 [September 25, 2017]
+// Last changed in libpng 1.6.33beta03 [September 27, 2017]
// The modifications in 2017 by Glenn Randers-Pehrson include
// 1. addition of a PNG_CLEANUP macro,
@@ -118,6 +118,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
return 0;
}
+ /* Treat benign errors as warnings */
+ png_set_benign_errors(png_handler.png_ptr, 1);
+
png_set_crc_action(png_handler.png_ptr, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE);
#ifdef PNG_IGNORE_ADLER32