Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(962)

Unified Diff: testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc

Issue 2740653002: Add setjmp() to progressive png fuzzer (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc
diff --git a/testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc b/testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc
index 4afa530900dcc93e088827d748b7d33e86267f63..c1b62ebaf4cfe00cacb453c921de90ceee20aee7 100644
--- a/testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc
+++ b/testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc
@@ -67,6 +67,10 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
&png_destroy_read_struct, &png_ptr, &info_ptr, nullptr));
#ifdef PNG_FUZZ_PROGRESSIVE
+ if (setjmp(png_jmpbuf(png_ptr))) {
+ return 0;
+ }
+
png_set_progressive_read_fn(png_ptr, nullptr, nullptr, nullptr, nullptr);
png_process_data(png_ptr, info_ptr, const_cast<uint8_t*>(data), size);
#else
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698