Flutter Engine
The Flutter Engine
FuzzParsePath.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2024 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 */
11
12void FuzzParsePath(const uint8_t* data, size_t size) {
14 // Put into a SkString first because we are not sure if the input
15 // data is null-terminated or not.
16 SkString input((const char*) data, size);
17 if (SkParsePath::FromSVGString(input.c_str(), &path)) {
20 // Do something with the output so it is not optimized away.
21 if (output1.startsWith("Impossible") || output2.startsWith("Impossible")) {
22 SK_ABORT("invalid SVG created");
23 }
24 }
25}
26
27#if defined(SK_BUILD_FOR_LIBFUZZER)
28extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
29 if (size > 1000) {
30 return 0;
31 }
33 return 0;
34}
35#endif
#define SK_ABORT(message,...)
Definition: SkAssert.h:70
static SkString ToSVGString(const SkPath &, PathEncoding=PathEncoding::Absolute)
static bool FromSVGString(const char str[], SkPath *)
Definition: SkPath.h:59
bool startsWith(const char prefixStr[]) const
Definition: SkString.h:140
const char * c_str() const
Definition: SkString.h:133
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
void FuzzParsePath(const uint8_t *data, size_t size)
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63