/src/serenity/Meta/Lagom/Fuzzers/FuzzTIFFLoader.cpp
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2023, the SerenityOS developers. |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #include <LibGfx/ImageFormats/TIFFLoader.h> |
8 | | #include <stdio.h> |
9 | | |
10 | | extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) |
11 | 45.9k | { |
12 | 45.9k | auto decoder_or_error = Gfx::TIFFImageDecoderPlugin::create({ data, size }); |
13 | 45.9k | if (decoder_or_error.is_error()) |
14 | 13.3k | return 0; |
15 | 32.6k | auto decoder = decoder_or_error.release_value(); |
16 | 32.6k | (void)decoder->frame(0); |
17 | 32.6k | return 0; |
18 | 45.9k | } |