| #include "dng_exceptions.h" |
| #include "dng_memory_stream.h" |
| #include "dng_negative.h" |
| extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { |
| dng_memory_stream stream(host.Allocator()); |
| stream.SetReadPosition(0); |
| std::unique_ptr<dng_negative> negative(host.Make_dng_negative()); |
| info.Parse(host, stream); |
| negative->Parse(host, stream, info); |
| negative->PostParse(host, stream, info); |
| negative->ReadStage1Image(host, stream, info); |
| } catch (dng_exception &e) { |
| // dng_sdk throws C++ exceptions on errors |
| // catch them here to prevent libFuzzer from crashing. |