Jonathan Metzman | 8264b31 | 2018-03-29 11:59:58 -0700 | [diff] [blame] | 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 | |
| 8 | #include "../Fuzz.h" |
Kevin Lubick | ec1c620 | 2018-12-14 11:42:53 -0500 | [diff] [blame] | 9 | #include "SkFontMgrPriv.h" |
Mike Klein | 0cffcbf9 | 2019-03-20 11:08:46 -0500 | [diff] [blame] | 10 | #include "TestFontMgr.h" |
Jonathan Metzman | 8264b31 | 2018-03-29 11:59:58 -0700 | [diff] [blame] | 11 | |
Kevin Lubick | 27d4219 | 2018-04-03 12:30:32 -0400 | [diff] [blame] | 12 | void fuzz_MockGPUCanvas(Fuzz* f); |
Jonathan Metzman | 8264b31 | 2018-03-29 11:59:58 -0700 | [diff] [blame] | 13 | |
| 14 | extern "C" { |
| 15 | |
| 16 | // Set default LSAN options. |
| 17 | const char *__lsan_default_options() { |
| 18 | // Don't print the list of LSAN suppressions on every execution. |
| 19 | return "print_suppressions=0"; |
| 20 | } |
| 21 | |
| 22 | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { |
Mike Klein | ea3f014 | 2019-03-20 11:12:10 -0500 | [diff] [blame^] | 23 | gSkFontMgr_DefaultFactory = &ToolUtils::MakePortableFontMgr; |
Jonathan Metzman | 8264b31 | 2018-03-29 11:59:58 -0700 | [diff] [blame] | 24 | auto fuzz = Fuzz(SkData::MakeWithoutCopy(data, size)); |
Kevin Lubick | 27d4219 | 2018-04-03 12:30:32 -0400 | [diff] [blame] | 25 | fuzz_MockGPUCanvas(&fuzz); |
Jonathan Metzman | 8264b31 | 2018-03-29 11:59:58 -0700 | [diff] [blame] | 26 | return 0; |
| 27 | } |
| 28 | } // extern "C" |