/src/skia/fuzz/oss_fuzz/FuzzMockGPUCanvas.cpp
Line | Count | Source (jump to first uncovered line) |
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/Fuzz.h" |
9 | | #include "src/core/SkFontMgrPriv.h" |
10 | | #include "tools/fonts/TestFontMgr.h" |
11 | | |
12 | | void fuzz_MockGPUCanvas(Fuzz* f); |
13 | | |
14 | | extern "C" { |
15 | | |
16 | | // Set default LSAN options. |
17 | 0 | const char *__lsan_default_options() { |
18 | | // Don't print the list of LSAN suppressions on every execution. |
19 | 0 | return "print_suppressions=0"; |
20 | 0 | } |
21 | | |
22 | 183k | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { |
23 | 183k | if (size > 4000) { |
24 | 151 | return 0; |
25 | 151 | } |
26 | 183k | gSkFontMgr_DefaultFactory = &ToolUtils::MakePortableFontMgr; |
27 | 183k | auto fuzz = Fuzz(SkData::MakeWithoutCopy(data, size)); |
28 | 183k | fuzz_MockGPUCanvas(&fuzz); |
29 | 183k | return 0; |
30 | 183k | } |
31 | | } // extern "C" |