From 4cc573a2327b81087eefb1eb70083486dacf58df Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Mon, 15 Jan 2018 23:03:27 +0100 Subject: [PATCH] Prepare for flag to allow writing. --- Magick++/fuzz/encoder_fuzzer.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Magick++/fuzz/encoder_fuzzer.cc b/Magick++/fuzz/encoder_fuzzer.cc index f6d722ffe..2d74f5e5a 100644 --- a/Magick++/fuzz/encoder_fuzzer.cc +++ b/Magick++/fuzz/encoder_fuzzer.cc @@ -10,6 +10,7 @@ #ifndef FUZZ_ENCODER #define FUZZ_ENCODER FUZZ_ENCODER_STRING_LITERAL_X(FUZZ_IMAGEMAGICK_ENCODER) #endif +#define FUZZ_IMAGEMAGICK_ENCODER_WRITE 1 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { const Magick::Blob blob(Data, Size); @@ -23,11 +24,14 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { return 0; } +#if FUZZ_IMAGEMAGICK_ENCODER_WRITE + Magick::Blob outBlob; try { image.write(&outBlob, FUZZ_ENCODER); } catch (Magick::Exception &e) { } +#endif return 0; } -- 2.40.0