Coverage Report

Created: 2025-07-07 10:01

/src/libreoffice/vcl/workben/pngfuzzer.cxx
Line
Count
Source (jump to first uncovered line)
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/filter/PngImageReader.hxx>
12
#include "commonfuzzer.hxx"
13
14
#include <config_features.h>
15
#include <osl/detail/component-mapping.h>
16
17
const lib_to_factory_mapping *
18
lo_get_factory_map(void)
19
0
{
20
0
    static lib_to_factory_mapping map[] = {
21
0
        { 0, 0 }
22
0
    };
23
24
0
    return map;
25
0
}
26
27
const lib_to_constructor_mapping *
28
lo_get_constructor_map(void)
29
379k
{
30
379k
    static lib_to_constructor_mapping map[] = {
31
379k
        { 0, 0 }
32
379k
    };
33
34
379k
    return map;
35
379k
}
36
37
extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
38
92
{
39
92
    TypicalFuzzerInitialize(argc, argv);
40
92
    return 0;
41
92
}
42
43
extern "C" void* lo_get_custom_widget_func(const char*)
44
0
{
45
0
    return nullptr;
46
0
}
47
48
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
49
440k
{
50
440k
    SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
51
440k
    vcl::PngImageReader aReader(aStream);
52
440k
    (void)aReader.read();
53
440k
    return 0;
54
440k
}
55
56
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */