blob: e65467af66826e6d422e18af4aa187b8cf2326a6 [file] [log] [blame]
Jonathan Metzman8264b312018-03-29 11:59:58 -07001/*
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 Lubickec1c6202018-12-14 11:42:53 -05009#include "SkFontMgrPriv.h"
Mike Klein0cffcbf92019-03-20 11:08:46 -050010#include "TestFontMgr.h"
Jonathan Metzman8264b312018-03-29 11:59:58 -070011
Kevin Lubick27d42192018-04-03 12:30:32 -040012void fuzz_MockGPUCanvas(Fuzz* f);
Jonathan Metzman8264b312018-03-29 11:59:58 -070013
14extern "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 Kleinea3f0142019-03-20 11:12:10 -050023 gSkFontMgr_DefaultFactory = &ToolUtils::MakePortableFontMgr;
Jonathan Metzman8264b312018-03-29 11:59:58 -070024 auto fuzz = Fuzz(SkData::MakeWithoutCopy(data, size));
Kevin Lubick27d42192018-04-03 12:30:32 -040025 fuzz_MockGPUCanvas(&fuzz);
Jonathan Metzman8264b312018-03-29 11:59:58 -070026 return 0;
27 }
28} // extern "C"