forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lagom/Fuzzers: Add a fuzzer for our TIFF decoder
- Loading branch information
1 parent
1ffb0d1
commit db8f11b
Showing
3 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (c) 2023, the SerenityOS developers. | ||
* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
||
#include <LibGfx/ImageFormats/TIFFLoader.h> | ||
#include <stdio.h> | ||
|
||
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) | ||
{ | ||
auto decoder_or_error = Gfx::TIFFImageDecoderPlugin::create({ data, size }); | ||
if (decoder_or_error.is_error()) | ||
return 0; | ||
auto decoder = decoder_or_error.release_value(); | ||
(void)decoder->frame(0); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,7 @@ | |
T(SQLParser) \ | ||
T(Tar) \ | ||
T(TGALoader) \ | ||
T(TIFFLoader) \ | ||
T(TTF) \ | ||
T(TinyVGLoader) \ | ||
T(URL) \ | ||
|