FuzzMockGPUCanvas.cpp 761 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright 2018 Google, LLC
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #include "fuzz/Fuzz.h"
  8. #include "src/core/SkFontMgrPriv.h"
  9. #include "tools/fonts/TestFontMgr.h"
  10. void fuzz_MockGPUCanvas(Fuzz* f);
  11. extern "C" {
  12. // Set default LSAN options.
  13. const char *__lsan_default_options() {
  14. // Don't print the list of LSAN suppressions on every execution.
  15. return "print_suppressions=0";
  16. }
  17. int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  18. gSkFontMgr_DefaultFactory = &ToolUtils::MakePortableFontMgr;
  19. auto fuzz = Fuzz(SkData::MakeWithoutCopy(data, size));
  20. fuzz_MockGPUCanvas(&fuzz);
  21. return 0;
  22. }
  23. } // extern "C"