texture.cpp 563 B

1234567891011121314151617181920
  1. #include "WallpaperEngine/Data/Parsers/TextureParser.h"
  2. #include "WallpaperEngine/Data/Utils/BinaryReader.h"
  3. #include <sstream>
  4. #include <tuple>
  5. using namespace WallpaperEngine::Data;
  6. extern "C" int LLVMFuzzerTestOneInput (const uint8_t* data, size_t size) {
  7. auto stream = std::make_shared<std::istringstream> (
  8. std::string (reinterpret_cast<const char*> (data), size), std::ios::binary
  9. );
  10. try {
  11. Utils::BinaryReader reader (stream);
  12. std::ignore = Parsers::TextureParser::parse (reader);
  13. } catch (const std::exception&) { }
  14. return 0;
  15. }