Flutter Engine
The Flutter Engine
FuzzPathDeserialize.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2018 Google Inc.
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#include "include/core/SkPath.h"
13
14void FuzzPathDeserialize(const uint8_t *data, size_t size) {
16
18 buf.readPath(&path);
19 if (!buf.isValid()) {
20 return;
21 }
22
24 if (!s) {
25 // May return nullptr in memory-constrained fuzzing environments
26 return;
27 }
28 s->getCanvas()->drawPath(path, SkPaint());
29}
30
31#if defined(SK_BUILD_FOR_LIBFUZZER)
32extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
33 if (size < 4 || size > 2000) {
34 return 0;
35 }
36 uint32_t packed;
37 memcpy(&packed, data, 4);
38 unsigned version = packed & 0xFF;
39 if (version != 4) {
40 // Chrome only will produce version 4, so guide the fuzzer to
41 // only focus on those branches.
42 return 0;
43 }
45 return 0;
46}
47#endif
void FuzzPathDeserialize(const uint8_t *data, size_t size)
Definition: SkPath.h:59
bool isValid() const
Definition: SkReadBuffer.h:208
void readPath(SkPath *path)
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
struct MyStruct s
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
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
static SkImageInfo MakeN32Premul(int width, int height)
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63