/src/h3/src/apps/fuzzers/fuzzerCellsToLinkedMultiPolygon.c
Line | Count | Source |
1 | | /* |
2 | | * Copyright 2021 Uber Technologies, Inc. |
3 | | * |
4 | | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | | * you may not use this file except in compliance with the License. |
6 | | * You may obtain a copy of the License at |
7 | | * |
8 | | * http://www.apache.org/licenses/LICENSE-2.0 |
9 | | * |
10 | | * Unless required by applicable law or agreed to in writing, software |
11 | | * distributed under the License is distributed on an "AS IS" BASIS, |
12 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | | * See the License for the specific language governing permissions and |
14 | | * limitations under the License. |
15 | | */ |
16 | | /** @file |
17 | | * @brief Fuzzer program for cellsToLinkedMultiPolygon |
18 | | */ |
19 | | |
20 | | #include "aflHarness.h" |
21 | | #include "h3api.h" |
22 | | #include "utility.h" |
23 | | |
24 | 887 | int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { |
25 | 887 | const H3Index *h3Set = (const H3Index *)data; |
26 | 887 | int sz = size / sizeof(H3Index); |
27 | | |
28 | 887 | LinkedGeoPolygon polygon; |
29 | 887 | H3Error err = H3_EXPORT(cellsToLinkedMultiPolygon)(h3Set, sz, &polygon); |
30 | | |
31 | 887 | if (!err) { |
32 | 669 | H3_EXPORT(destroyLinkedMultiPolygon)(&polygon); |
33 | 669 | } |
34 | 887 | return 0; |
35 | 887 | } |
36 | | |
37 | | AFL_HARNESS_MAIN(sizeof(H3Index) * 1024); |