1 #include <cstdint> 2 3 #include <Magick++/Blob.h> 4 #include <Magick++/Image.h> 5 6 #include "utils.cc" 7 LLVMFuzzerTestOneInput(const uint8_t * Data,size_t Size)8extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { 9 if (Size < sizeof(double)) { 10 return 0; 11 } 12 double Degrees = *reinterpret_cast<const double *>(Data); 13 if (!isfinite(Degrees)) { 14 return 0; 15 } 16 const Magick::Blob blob(Data + sizeof(Degrees), Size - sizeof(Degrees)); 17 Magick::Image image; 18 try { 19 image.read(blob); 20 image.rotate(Degrees); 21 } catch (Magick::Exception &e) { 22 return 0; 23 } 24 return 0; 25 } 26 27 #include "travis.cc" 28