Coverage Report

Created: 2025-11-16 06:12

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/stb/tests/stbi_read_fuzzer.c
Line
Count
Source
1
#ifdef __cplusplus
2
extern "C" {
3
#endif
4
5
#define STB_IMAGE_IMPLEMENTATION
6
7
#include "../stb_image.h"
8
9
10
int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
11
288
{
12
288
    int x, y, channels;
13
14
288
    if(!stbi_info_from_memory(data, size, &x, &y, &channels)) return 0;
15
16
    /* exit if the image is larger than ~80MB */
17
288
    if(y && x > (80000000 / 4) / y) return 0;
18
19
288
    unsigned char *img = stbi_load_from_memory(data, size, &x, &y, &channels, 4);
20
21
288
    free(img);
22
23
288
    return 0;
24
288
}
25
26
#ifdef __cplusplus
27
}
28
#endif