Coverage Report

Created: 2025-10-10 06:05

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/skcms/fuzz/fuzz_iccprofile_atf.c
Line
Count
Source
1
/*
2
 * Copyright 2018 Google Inc.
3
 *
4
 * Use of this source code is governed by a BSD-style license that can be
5
 * found in the LICENSE file.
6
 */
7
8
// This fuzz target parses an ICCProfile and then computes the
9
// approximateTransferFunction.  This is separate from fuzz_iccprofile_info
10
// because it is a much more time-consuming function call.
11
12
#include "../src/skcms_public.h"
13
14
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
15
3.30k
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
16
3.30k
    skcms_ICCProfile p;
17
3.30k
    if (!skcms_Parse(data, size, &p)) {
18
2.65k
        return 0;
19
2.65k
    }
20
21
653
    skcms_TransferFunction tf;
22
653
    float max_error;
23
2.61k
    for (int i = 0; i < 3; ++i) {
24
1.95k
        (void)skcms_ApproximateCurve(&p.trc[i], &tf, &max_error);
25
1.95k
        (void)max_error;
26
1.95k
    }
27
28
653
    return 0;
29
3.30k
}