Skip to content

Commit 7c902b1

Browse files
committed
Small modifications.
1 parent 3f9a125 commit 7c902b1

File tree

5 files changed

+24
-22
lines changed

5 files changed

+24
-22
lines changed

CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ option(OJPH_ENABLE_TIFF_SUPPORT "Enables input and output support for TIFF files
4141
option(OJPH_BUILD_TESTS "Enables building test code" OFF)
4242
option(OJPH_BUILD_EXECUTABLES "Enables building command line executables" ON)
4343
option(OJPH_BUILD_STREAM_EXPAND "Enables building ojph_stream_expand executable" OFF)
44+
option(OJPH_BUILD_FUZZER "Enable building oss-fuzzing executable" OFF)
4445

4546
option(OJPH_DISABLE_SIMD "Disables the use of SIMD instructions -- agnostic to architectures" OFF)
4647
option(OJPH_DISABLE_SSE "Disables the use of SSE SIMD instructions and associated files" OFF)
@@ -243,9 +244,7 @@ endif()
243244
# Fuzzing
244245
################################################################################################
245246

246-
option(ENABLE_FUZZING "Enable fuzzing" OFF)
247-
248-
if(ENABLE_FUZZING)
247+
if(OJPH_BUILD_FUZZER)
249248
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
250249
message(FATAL_ERROR "Fuzzing requires a Clang toolchain.")
251250
endif()

README.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,7 @@ The standard is available free of charge from [ITU website](https://www.itu.int/
1818
* [Usage Example](./docs/usage_examples.md)
1919
* [Web-based Demos](./docs/web_demos.md)
2020
* [Doxygen Documentation Style](./docs/doxygen_style.md)
21+
* [OSS-Fuzzing](./docs/fuzzing.md)
2122

2223
# Repositories #
2324
[![Packaging status](https://repology.org/badge/vertical-allrepos/openjph.svg)](https://repology.org/project/openjph/versions)
24-
25-
# Fuzzer Target #
26-
27-
Fuzzer targets can be build using the `ENABLE_FUZZING` build option. The Dockerfile in the `fuzzing directory` allows local testing:
28-
29-
```sh
30-
podman build -t openjph-fuzz -f fuzzing/Dockerfile
31-
podman run -it --rm -v $(pwd):/app/ojph/ openjph-fuzz bash
32-
image# mkdir /app/build/
33-
image# cd /app/build/
34-
image# cmake /app/ojph -DENABLE_FUZZING=ON
35-
image# make
36-
image# ./fuzzing/j2c_expand_fuzz_target /app/jp2k_test_codestreams/openjph/*.j2c
37-
```

docs/fuzzing.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# OSS-Fuzzer Target #
2+
3+
Fuzzer targets can be build using the `OJPH_BUILD_FUZZER` build option. The Dockerfile in the `fuzzing directory` allows local testing:
4+
5+
```sh
6+
podman build -t openjph-fuzz -f fuzzing/Dockerfile
7+
podman run -it --rm -v $(pwd):/app/ojph/ openjph-fuzz bash
8+
image# mkdir /app/build/
9+
image# cd /app/build/
10+
image# cmake /app/ojph -DOJPH_BUILD_FUZZER=ON
11+
image# make
12+
image# ./fuzzing/ojph_expand_fuzz_target /app/jp2k_test_codestreams/openjph/*.j2c
13+
```

fuzzing/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
add_executable(j2c_expand_fuzz_target fuzz_targets/j2c_expand_fuzz_target.cpp)
1+
## building ojph_expand_fuzz_target
2+
###################################
23

3-
target_compile_options(j2c_expand_fuzz_target PRIVATE -fsanitize=fuzzer,address)
4-
target_link_options(j2c_expand_fuzz_target PRIVATE -fsanitize=fuzzer,address)
5-
target_link_libraries(j2c_expand_fuzz_target PRIVATE openjph)
4+
add_executable(ojph_expand_fuzz_target fuzz_targets/ojph_expand_fuzz_target.cpp)
5+
6+
target_compile_options(ojph_expand_fuzz_target PRIVATE -fsanitize=fuzzer,address)
7+
target_link_options(ojph_expand_fuzz_target PRIVATE -fsanitize=fuzzer,address)
8+
target_link_libraries(ojph_expand_fuzz_target PRIVATE openjph)
69

fuzzing/fuzz_targets/j2c_expand_fuzz_target.cpp renamed to fuzzing/fuzz_targets/ojph_expand_fuzz_target.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
//***************************************************************************/
3030
// This file is part of the OpenJPH software implementation.
31-
// File: j2c_expand_fuzz_target.cpp
31+
// File: ojph_expand_fuzz_target.cpp
3232
// Author: Pierre-Anthony Lemieux
3333
// Date: 17 February 2026
3434
//***************************************************************************/

0 commit comments

Comments
 (0)