Skip to content

Conversation

@skypher
Copy link

@skypher skypher commented Dec 22, 2025

Summary

This PR adds 10 new fuzz targets to significantly improve OSS-Fuzz code coverage from the current ~50% to an estimated 85-95%. The new fuzzers cover previously untested code paths including encoder APIs, tile-based operations, MCT, and metadata functions.

New Fuzz Targets

Fuzzer Coverage Target
opj_compress_fuzzer Basic encoder fuzzing
opj_tile_fuzzer Tile-based decoding (opj_get_decoded_tile, etc.)
opj_decode_area_fuzzer Partial area decoding with threading
opj_roundtrip_fuzzer Encode-then-decode for encoder validation
opj_components_fuzzer Selective component decoding
opj_tiled_encoder_fuzzer Tile-based encoding (opj_write_tile)
opj_dump_info_fuzzer Metadata/index APIs
opj_mct_fuzzer MCT matrices and cinema profiles
opj_encoder_options_fuzzer Extended options (PLT, TLM, GUARD_BITS)
opj_subsampled_fuzzer Subsampling patterns and ROI encoding

Additional Improvements

  • Dictionary: JPEG 2000 dictionary with 80+ tokens for guided fuzzing
  • Seed Corpus: Synthetic seed corpus for encoder fuzzers
  • Options Files: Timeout/max_len settings for slow fuzzers
  • Build Script: Updated to support all new fuzzers and copy resources

Previously Uncovered Functions Now Tested

  • opj_write_tile, opj_image_tile_create
  • opj_get_decoded_tile, opj_read_tile_header, opj_decode_tile_data
  • opj_set_decode_area, opj_set_decoded_components
  • opj_set_MCT, opj_encoder_set_extra_options
  • opj_get_cstr_info, opj_get_cstr_index, opj_dump_codec
  • opj_decoder_set_strict_mode, opj_codec_set_threads

Test Plan

  • All 12 fuzzers build successfully with libFuzzer
  • All fuzzers pass basic sanity tests with sample inputs
  • Dictionary and seed corpus validated
  • Build script tested end-to-end

This PR adds 10 new fuzz targets to significantly improve code coverage
from the current ~50% to an estimated 85-95%. The new fuzzers cover
previously untested code paths including:

New fuzz targets:
- opj_compress_fuzzer: Basic encoder fuzzing
- opj_tile_fuzzer: Tile-based decoding (opj_get_decoded_tile, etc.)
- opj_decode_area_fuzzer: Partial area decoding with threading
- opj_roundtrip_fuzzer: Encode-then-decode for encoder validation
- opj_components_fuzzer: Selective component decoding
- opj_tiled_encoder_fuzzer: Tile-based encoding (opj_write_tile)
- opj_dump_info_fuzzer: Metadata/index APIs (opj_get_cstr_info, etc.)
- opj_mct_fuzzer: MCT matrices and cinema profiles
- opj_encoder_options_fuzzer: Extended options (PLT, TLM, GUARD_BITS)
- opj_subsampled_fuzzer: Subsampling patterns and ROI encoding

Additional improvements:
- Add JPEG 2000 dictionary (80+ tokens) for guided fuzzing
- Add synthetic seed corpus for encoder fuzzers
- Add options files for slow fuzzers (timeout/max_len settings)
- Update build script to support all new fuzzers and copy resources

Previously uncovered functions now tested:
- opj_write_tile, opj_image_tile_create
- opj_get_decoded_tile, opj_read_tile_header, opj_decode_tile_data
- opj_set_decode_area, opj_set_decoded_components
- opj_set_MCT, opj_encoder_set_extra_options
- opj_get_cstr_info, opj_get_cstr_index, opj_dump_codec
- opj_decoder_set_strict_mode, opj_codec_set_threads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant