Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
FuzzSkDescriptorDeserialize.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2019 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
10
11void FuzzSkDescriptorDeserialize(const uint8_t *data, size_t size) {
12 SkReadBuffer buffer{data, size};
14 if (!sut.has_value()) {
15 return;
16 }
17
18 auto desc = sut->getDesc();
19
20 desc->computeChecksum();
21 desc->isValid();
22
23 // An arbitrary number
24 uint32_t tagToFind = 117;
25
26 uint32_t ignore;
27 desc->findEntry(tagToFind, &ignore);
28}
29
30#if defined(SK_BUILD_FOR_LIBFUZZER)
31extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
32 if (size > 1024) {
33 return 0;
34 }
36 return 0;
37}
38#endif
void FuzzSkDescriptorDeserialize(const uint8_t *data, size_t size)
static std::optional< SkAutoDescriptor > MakeFromBuffer(SkReadBuffer &buffer)
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
static const uint8_t buffer[]