Fuzz introspector
For issues and ideas: https://github.com/ossf/fuzz-introspector/issues

Fuzzer details

Fuzzer: opj_decompress_fuzzer_JP2

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 79 35.9%
gold [1:9] 10 4.54%
yellow [10:29] 24 10.9%
greenyellow [30:49] 9 4.09%
lawngreen 50+ 98 44.5%
All colors 220 100

Fuzz blockers

The followings are the branches where fuzzer fails to bypass.

Unique non-covered Complexity Unique Reachable Complexities Unique Reachable Functions All non-covered Complexity All Reachable Complexity Function Name Function Callsite Blocked Branch
524 524 15 :

['rev_init', 'rev_init_mrp', 'mel_init', 'rev_advance_mrp', 'population_count', 'count_leading_zeros', 'frwd_init', 'rev_advance', 'frwd_advance', 'decode_init_uvlc', 'frwd_fetch', 'rev_fetch', 'rev_fetch_mrp', 'mel_get_run', 'decode_noninit_uvlc']

524 724 opj_t1_ht_decode_cblk call site: 00000 /src/openjpeg/src/lib/openjp2/ht_dec.c:1298
420 816 13 :

['opj_uint_min.1245', 'opj_dwt_max_resolution', 'opj_dwt_get_band_coordinates', 'opj_aligned_free', 'opj_dwt_segment_grow', 'opj_uint_max.1249', 'opj_uint_subs', 'opj_dwt_interleave_partial_v', 'opj_aligned_32_malloc', 'opj_dwt_decode_partial_1_parallel', 'opj_dwt_interleave_partial_h', 'opj_dwt_decode_partial_1', 'opj_sparse_array_int32_write']

420 977 opj_dwt_decode_partial_tile call site: 00000 /src/openjpeg/src/lib/openjp2/dwt.c:2869
252 252 1 :

['opj_j2k_create_compress']

252 438 opj_jp2_create call site: 00167 /src/openjpeg/src/lib/openjp2/jp2.c:3155
138 443 11 :

['opj_thread_pool_wait_completion', 'opj_dwt_max_resolution', 'opj_v8dwt_decode', 'opj_aligned_malloc', 'opj_free', 'opj_uint_max.1249', 'opj_aligned_free', 'opj_malloc', 'opj_thread_pool_submit_job', 'opj_v8dwt_interleave_h', 'opj_v8dwt_interleave_v']

138 443 opj_dwt_decode_tile_97 call site: 00000 /src/openjpeg/src/lib/openjp2/dwt.c:3534
98 164 3 :

['opj_mutex_create', 'opj_thread_pool_setup', 'opj_thread_pool_destroy']

98 166 opj_thread_pool_create call site: 00027 /src/openjpeg/src/lib/openjp2/thread.c:635
19 26 3 :

['opj_mct_decode_custom', 'opj_malloc', 'opj_free']

19 26 opj_tcd_mct_decode call site: 00000 /src/openjpeg/src/lib/openjp2/tcd.c:2192
16 16 1 :

['opj_mct_decode']

16 16 opj_tcd_mct_decode call site: 00000 /src/openjpeg/src/lib/openjp2/tcd.c:2229
10 10 3 :

['opj_get_num_cpus', 'strcmp', 'atoi']

10 10 opj_j2k_get_default_thread_count call site: 00020 /src/openjpeg/src/lib/openjp2/j2k.c:6795
8 38 6 :

['opj_mutex_unlock', 'opj_cond_wait', 'opj_free', 'opj_mutex_lock', 'opj_cond_signal', 'opj_malloc']

8 38 opj_thread_pool_submit_job call site: 00000 /src/openjpeg/src/lib/openjp2/thread.c:834
4 12 3 :

['opj_mutex_lock', 'opj_cond_wait', 'opj_mutex_unlock']

4 12 opj_thread_pool_wait_completion call site: 00064 /src/openjpeg/src/lib/openjp2/thread.c:897
0 113 3 :

['opj_event_msg', 'opj_read_bytes_LE', 'opj_malloc']

0 113 opj_jp2_read_colr call site: 00000 /src/openjpeg/src/lib/openjp2/jp2.c:1518
0 22 1 :

['opj_j2k_update_image_dimensions']

0 4393 opj_j2k_decode call site: 00000 /src/openjpeg/src/lib/openjp2/j2k.c:12368

Runtime coverage analysis

Covered functions
293
Functions that are reachable but not covered
33
Reachable functions
96
Percentage of reachable functions covered
65.62%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Warning: The number of covered functions are larger than the number of reachable functions. This means that there are more functions covered at runtime than are extracted using static analysis. This is likely a result of the static analysis component failing to extract the right call graph or the coverage runtime being compiled with sanitizers in code that the static analysis has not analysed. This can happen if lto/gold is not used in all places that coverage instrumentation is used.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
./tests/fuzzers/opj_decompress_fuzzer_JP2.cpp 7
src/lib/openjp2/openjpeg.c 12
src/lib/openjp2/opj_malloc.c 4
src/lib/openjp2/j2k.c 9
src/lib/openjp2/function_list.c 2
src/lib/openjp2/thread.c 19
/usr/include/stdlib.h 1
src/lib/openjp2/tcd.c 2
src/lib/openjp2/tgt.c 1
src/lib/openjp2/image.c 1
src/lib/openjp2/jp2.c 2
src/lib/openjp2/event.c 2
src/lib/openjp2/cio.c 7

Fuzzer: opj_decompress_fuzzer_J2K

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 96 43.6%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 2 0.90%
lawngreen 50+ 122 55.4%
All colors 220 100

Fuzz blockers

The followings are the branches where fuzzer fails to bypass.

Unique non-covered Complexity Unique Reachable Complexities Unique Reachable Functions All non-covered Complexity All Reachable Complexity Function Name Function Callsite Blocked Branch
98 164 3 :

['opj_mutex_create', 'opj_thread_pool_setup', 'opj_thread_pool_destroy']

98 166 opj_thread_pool_create call site: 00027 /src/openjpeg/src/lib/openjp2/thread.c:635
19 26 3 :

['opj_mct_decode_custom', 'opj_malloc', 'opj_free']

19 26 opj_tcd_mct_decode call site: 00000 /src/openjpeg/src/lib/openjp2/tcd.c:2192
10 10 3 :

['opj_get_num_cpus', 'strcmp', 'atoi']

10 10 opj_j2k_get_default_thread_count call site: 00020 /src/openjpeg/src/lib/openjp2/j2k.c:6795
8 38 6 :

['opj_mutex_unlock', 'opj_cond_wait', 'opj_free', 'opj_mutex_lock', 'opj_cond_signal', 'opj_malloc']

8 38 opj_thread_pool_submit_job call site: 00000 /src/openjpeg/src/lib/openjp2/thread.c:834
4 12 3 :

['opj_mutex_lock', 'opj_cond_wait', 'opj_mutex_unlock']

4 12 opj_thread_pool_wait_completion call site: 00064 /src/openjpeg/src/lib/openjp2/thread.c:897
0 22 1 :

['opj_j2k_update_image_dimensions']

0 4393 opj_j2k_decode call site: 00000 /src/openjpeg/src/lib/openjp2/j2k.c:12368
0 20 3 :

['opj_event_msg', 'opj_calloc', 'opj_free']

0 20 opj_j2k_build_tp_index_from_tlm call site: 00000 /src/openjpeg/src/lib/openjp2/j2k.c:8894
0 15 2 :

['opj_event_msg', 'opj_t1_destroy']

0 17 opj_t1_clbl_decode_processor call site: 00000 /src/openjpeg/src/lib/openjp2/t1.c:1680
0 12 2 :

['opj_event_msg', 'opj_tgt_destroy']

0 12 opj_tgt_init call site: 00000 /src/openjpeg/src/lib/openjp2/tgt.c:181
0 8 2 :

['opj_mutex_lock', 'opj_mutex_unlock']

0 16 opj_t1_clbl_decode_processor call site: 00000 /src/openjpeg/src/lib/openjp2/t1.c:1635
0 8 2 :

['opj_event_msg', 'opj_free']

0 8 opj_j2k_read_sot call site: 00000 /src/openjpeg/src/lib/openjp2/j2k.c:4692
0 8 2 :

['opj_event_msg', 'opj_free']

0 8 opj_tgt_create call site: 00000 /src/openjpeg/src/lib/openjp2/tgt.c:91

Runtime coverage analysis

Covered functions
324
Functions that are reachable but not covered
35
Reachable functions
96
Percentage of reachable functions covered
63.54%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Warning: The number of covered functions are larger than the number of reachable functions. This means that there are more functions covered at runtime than are extracted using static analysis. This is likely a result of the static analysis component failing to extract the right call graph or the coverage runtime being compiled with sanitizers in code that the static analysis has not analysed. This can happen if lto/gold is not used in all places that coverage instrumentation is used.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
./tests/fuzzers/opj_decompress_fuzzer_J2K.cpp 7
src/lib/openjp2/openjpeg.c 12
src/lib/openjp2/opj_malloc.c 4
src/lib/openjp2/j2k.c 9
src/lib/openjp2/function_list.c 2
src/lib/openjp2/thread.c 19
/usr/include/stdlib.h 1
src/lib/openjp2/tcd.c 2
src/lib/openjp2/tgt.c 1
src/lib/openjp2/image.c 1
src/lib/openjp2/jp2.c 2
src/lib/openjp2/event.c 2
src/lib/openjp2/cio.c 7

Analyses and suggestions

Optimal target analysis

Remaining optimal interesting functions

The following table shows a list of functions that are optimal targets. Optimal targets are identified by finding the functions that in combination, yield a high code coverage.

Func name Functions filename Arg count Args Function depth hitcount instr count bb count cyclomatic complexity Reachable functions Incoming references total cyclomatic complexity Unreached complexity
opj_jp2_decode /src/openjpeg/src/lib/openjp2/jp2.c 4 ['N/A', 'N/A', 'N/A', 'N/A'] 13 0 37 8 4 254 0 4489 4403
opj_jp2_encode /src/openjpeg/src/lib/openjp2/jp2.c 3 ['N/A', 'N/A', 'N/A'] 13 0 16 3 2 188 0 1857 1345
opj_jp2_setup_encoder /src/openjpeg/src/lib/openjp2/jp2.c 4 ['N/A', 'N/A', 'N/A', 'N/A'] 4 0 679 117 47 33 0 523 490
opj_jp2_start_compress /src/openjpeg/src/lib/openjp2/jp2.c 4 ['N/A', 'N/A', 'N/A', 'N/A'] 8 0 59 12 6 99 0 562 388
opj_jp2_read_header /src/openjpeg/src/lib/openjp2/jp2.c 4 ['N/A', 'N/A', 'N/A', 'N/A'] 7 0 145 31 15 47 0 316 177
opj_j2k_read_siz /src/openjpeg/src/lib/openjp2/j2k.c 4 ['N/A', 'N/A', 'int', 'N/A'] 3 0 789 130 55 12 0 101 65
jp2_dump /src/openjpeg/src/lib/openjp2/jp2.c 3 ['N/A', 'int', 'N/A'] 4 0 16 3 2 10 0 67 65
opj_jp2_get_tile /src/openjpeg/src/lib/openjp2/jp2.c 5 ['N/A', 'N/A', 'N/A', 'N/A', 'int'] 13 0 39 8 4 251 0 4427 47
opj_j2k_read_cod /src/openjpeg/src/lib/openjp2/j2k.c 4 ['N/A', 'N/A', 'int', 'N/A'] 3 0 262 42 17 5 0 64 44
opj_jp2_end_compress /src/openjpeg/src/lib/openjp2/jp2.c 3 ['N/A', 'N/A', 'N/A'] 7 0 40 8 4 30 0 138 43

Implementing fuzzers that target the above functions will improve reachability such that it becomes:

Functions statically reachable by fuzzers
79.0%
518 / 653
Cyclomatic complexity statically reachable by fuzzers
90.0%
7375 / 8165

All functions overview

If you implement fuzzers for these functions, the status of all functions in the project will be:

Func name Functions filename Args Function call depth Reached by Fuzzers Fuzzers runtime hit Func lines hit % I Count BB Count Cyclomatic complexity Functions reached Reached by functions Accumulated cyclomatic complexity Undiscovered complexity

Files and Directories in report

This section shows which files and directories are considered in this report. The main reason for showing this is fuzz introspector may include more code in the reasoning than is desired. This section helps identify if too many files/directories are included, e.g. third party code, which may be irrelevant for the threat model. In the event too much is included, fuzz introspector supports a configuration file that can exclude data from the report. See the following link for more information on how to create a config file: link

Files in report

Source file Reached by Covered by
[] []
/src/openjpeg/src/lib/openjp2/cio.c ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K'] ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K']
/src/openjpeg/src/lib/openjp2/sparse_array.c [] []
/src/openjpeg/src/lib/openjp2/mct.c [] []
/src/openjpeg/src/lib/openjp2/dwt.c [] []
/src/openjpeg/src/lib/openjp2/openjpeg.c ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K'] ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K']
/src/openjpeg/src/lib/openjp2/t2.c [] []
/src/openjpeg/src/lib/openjp2/tgt.c ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K'] ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K']
/src/openjpeg/src/lib/openjp2/opj_intmath.h [] []
/src/openjpeg/src/lib/openjp2/mqc_inl.h [] []
/src/openjpeg/src/lib/openjp2/bio.c [] []
/src/openjpeg/src/lib/openjp2/event.c ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K'] ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K']
/src/openjpeg/src/lib/openjp2/image.c ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K'] ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K']
/src/openjpeg/src/lib/openjp2/ht_dec.c [] []
/src/openjpeg/src/lib/openjp2/invert.c [] []
/src/openjpeg/./tests/fuzzers/opj_decompress_fuzzer_J2K.cpp ['opj_decompress_fuzzer_J2K'] []
/src/openjpeg/src/lib/openjp2/t1.c [] []
/src/openjpeg/src/lib/openjp2/mqc.c [] []
/src/openjpeg/src/lib/openjp2/tcd.c ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K'] ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K']
/src/openjpeg/src/lib/openjp2/opj_includes.h [] []
/src/openjpeg/src/lib/openjp2/function_list.c ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K'] ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K']
/src/openjpeg/src/lib/openjp2/jp2.c ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K'] ['opj_decompress_fuzzer_JP2']
/src/openjpeg/src/lib/openjp2/opj_malloc.c ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K'] ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K']
/src/openjpeg/./tests/fuzzers/opj_decompress_fuzzer_JP2.cpp ['opj_decompress_fuzzer_JP2'] []
/usr/include/stdlib.h ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K'] []
/src/openjpeg/src/lib/openjp2/pi.c [] []
/src/openjpeg/src/lib/openjp2/j2k.c ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K'] ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K']
/src/openjpeg/src/lib/openjp2/thread.c ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K'] ['opj_decompress_fuzzer_JP2', 'opj_decompress_fuzzer_J2K']

Directories in report

Directory
/src/openjpeg/./tests/fuzzers/
/usr/include/
/src/openjpeg/src/lib/openjp2/