Coverage Report

Created: 2026-10-28 06:34

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libcdr/src/fuzz/cdrfuzzer.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 libcdr 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 <cstdint>
11
#include <cstdlib>
12
13
#include <libcdr/libcdr.h>
14
15
#include <librevenge-generators/RVNGDummyDrawingGenerator.h>
16
17
#include <librevenge-stream/librevenge-stream.h>
18
19
#include "fuzzerlimits.hxx"
20
21
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
22
1.59M
{
23
1.59M
  if (size > maxFuzzInputSize)
24
132
    return 0;
25
1.59M
  librevenge::RVNGStringStream input(data, size);
26
1.59M
  librevenge::RVNGDummyDrawingGenerator generator;
27
1.59M
  libcdr::CDRDocument::parse(&input, &generator);
28
1.59M
  return 0;
29
1.59M
}
30
31
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */