/src/libreoffice/vcl/workben/pctfuzzer.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | */ |
9 | | |
10 | | #include <tools/stream.hxx> |
11 | | #include <vcl/FilterConfigItem.hxx> |
12 | | #include "commonfuzzer.hxx" |
13 | | #include <filter/PictReader.hxx> |
14 | | |
15 | | #include <config_features.h> |
16 | | #include <osl/detail/component-mapping.h> |
17 | | |
18 | | const lib_to_factory_mapping * |
19 | | lo_get_factory_map(void) |
20 | 0 | { |
21 | 0 | static lib_to_factory_mapping map[] = { |
22 | 0 | { 0, 0 } |
23 | 0 | }; |
24 | |
|
25 | 0 | return map; |
26 | 0 | } |
27 | | |
28 | | const lib_to_constructor_mapping * |
29 | | lo_get_constructor_map(void) |
30 | 347k | { |
31 | 347k | static lib_to_constructor_mapping map[] = { |
32 | 347k | { 0, 0 } |
33 | 347k | }; |
34 | | |
35 | 347k | return map; |
36 | 347k | } |
37 | | |
38 | | extern "C" void* lo_get_custom_widget_func(const char*) |
39 | 0 | { |
40 | 0 | return nullptr; |
41 | 0 | } |
42 | | |
43 | | extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) |
44 | 94 | { |
45 | 94 | TypicalFuzzerInitialize(argc, argv); |
46 | 94 | return 0; |
47 | 94 | } |
48 | | |
49 | | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) |
50 | 457k | { |
51 | 457k | SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ); |
52 | 457k | Graphic aGraphic; |
53 | 457k | (void)ImportPictGraphic(aStream, aGraphic); |
54 | 457k | return 0; |
55 | 457k | } |
56 | | |
57 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |