Chromium Code Reviews| 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 1ea45d36c565ad305b889ec67482bbf30bfc216f..06bae03207358e885ca1490d6bee87f6e4cbea89 100644 |
| --- a/testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc |
| +++ b/testing/libfuzzer/fuzzers/libpng_read_fuzzer.cc |
| @@ -46,6 +46,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
| (PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); |
| assert(png_ptr); |
| +#ifdef MEMORY_SANITIZER |
|
aizatsky
2016/09/29 17:14:40
why not to make it unconditional? Seems like a goo
mmoroz
2016/09/30 08:28:59
I would like to agree, but:
1) we lose some covera
aizatsky
2016/09/30 17:51:52
Understood. Please try to make it an if() statemen
mmoroz
2016/10/04 12:38:26
I've searched for something to do that, but haven'
|
| + // To avoid OOM with MSan (crbug.com/648073). These values are recommended as |
| + // safe settings by https://github.com/glennrp/libpng/blob/libpng16/pngusr.dfa |
| + png_set_user_limits(png_ptr, 65535, 65535); |
| +#endif |
| + |
| png_set_crc_action(png_ptr, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE); |
| png_infop info_ptr = png_create_info_struct(png_ptr); |