Home | History | Annotate | Download | only in fuzz
      1 #include <Magick++/Functions.h>
      2 #include <Magick++/ResourceLimits.h>
      3 #include <Magick++/SecurityPolicy.h>
      4 
      5 #ifndef FUZZ_MAX_SIZE
      6 #define FUZZ_MAX_SIZE 2048
      7 #endif
      8 
      9 class FuzzingInitializer {
     10 public:
     11   FuzzingInitializer() {
     12     Magick::InitializeMagick((const char *) NULL);
     13     Magick::SecurityPolicy::maxMemoryRequest(256000000);
     14     Magick::ResourceLimits::memory(1000000000);
     15     Magick::ResourceLimits::map(500000000);
     16     Magick::ResourceLimits::width(FUZZ_MAX_SIZE);
     17     Magick::ResourceLimits::height(FUZZ_MAX_SIZE);
     18     Magick::ResourceLimits::listLength(32);
     19   }
     20 };
     21 
     22 FuzzingInitializer fuzzingInitializer;
     23 
     24 #if BUILD_MAIN
     25 #include "encoder_format.h"
     26 
     27 EncoderFormat encoderFormat;
     28 
     29 #define FUZZ_ENCODER encoderFormat.get()
     30 #endif // BUILD_MAIN
     31