🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
831 B

  1. #include <stdint.h>
  2. #include <stddef.h>
  3. #define TINYEXR_IMPLEMENTATION
  4. #include "tinyexr.h"
  5. extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  6. EXRVersion exr_version;
  7. EXRImage exr_image;
  8. EXRHeader exr_header;
  9. int ret = ParseEXRVersionFromMemory(&exr_version, data, size);
  10. if (ret != TINYEXR_SUCCESS) {
  11. return 0;
  12. }
  13. InitEXRHeader(&exr_header);
  14. ret = ParseEXRHeaderFromMemory(&exr_header, &exr_version, data, size, NULL);
  15. if (ret != TINYEXR_SUCCESS) {
  16. FreeEXRHeader(&exr_header);
  17. return 0;
  18. }
  19. InitEXRImage(&exr_image);
  20. ret = LoadEXRImageFromMemory(&exr_image, &exr_header, data, size, NULL);
  21. if (ret != TINYEXR_SUCCESS) {
  22. FreeEXRHeader(&exr_header);
  23. FreeEXRImage(&exr_image);
  24. return 0;
  25. }
  26. FreeEXRHeader(&exr_header);
  27. FreeEXRImage(&exr_image);
  28. return 0;
  29. }