/src/libvisio/src/fuzz/vsdxfuzzer.cpp
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* |
3 | | * This file is part of the libvisio 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 <algorithm> |
11 | | #include <cstdint> |
12 | | |
13 | | #include <libvisio/libvisio.h> |
14 | | |
15 | | #include <librevenge-generators/RVNGDummyDrawingGenerator.h> |
16 | | |
17 | | #include <librevenge-stream/librevenge-stream.h> |
18 | | |
19 | | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) |
20 | 1.25M | { |
21 | 1.25M | librevenge::RVNGStringStream input(data, size); |
22 | 1.25M | librevenge::RVNGDummyDrawingGenerator generator; |
23 | 1.25M | libvisio::VisioDocument::parse(&input, &generator); |
24 | 1.25M | return 0; |
25 | 1.25M | } |
26 | | |
27 | | /* vim:set shiftwidth=2 softtabstop=2 expandtab: */ |