fuzzers: add opj_compress_fuzzer for J2K/JP2 encode path#1645
Open
XananasX7 wants to merge 1 commit into
Open
Conversation
Author
|
Friendly ping — happy to address any review comments. Thank you! |
Collaborator
|
formatting fixes to address: https://github.com/uclouvain/openjpeg/actions/runs/27315401875/job/82500689891?pr=1645 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The existing OSS-Fuzz harnesses cover only decompression:
opj_decompress_fuzzer_J2K–.j2k/.jphcodestream decodeopj_decompress_fuzzer_JP2–.jp2JP2 container decodeThe encode path (
src/lib/openjp2/j2k.c,jp2.c,tcd.c) has no OSS-Fuzz coverage.New harness:
tests/fuzzers/opj_compress_fuzzer.cppDerives image parameters (width, height, components, lossy flag, J2K vs JP2) from fuzz input, builds an
opj_image_twith fuzz-derived pixel data, then runs a full encode viaopj_setup_encoder → opj_start_compress → opj_encode → opj_end_compress, writing output to an in-memory write-stream using custom callbacks (matching the pattern of existing decompress fuzzers).Covers: DWT forward transform, tier-1/tier-2 encoding, rate-distortion optimisation, JP2 box serialisation in
jp2.c.