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

Fuzzer details

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 42.6%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 129 57.3%
All colors 225 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
94 160 3 :

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

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

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

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

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

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

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

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

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

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

['opj_j2k_update_image_dimensions']

0 4361 opj_j2k_decode call site: 00000 /src/openjpeg/src/lib/openjp2/j2k.c:12004
0 15 2 :

['opj_t1_destroy', 'opj_event_msg']

0 17 opj_t1_clbl_decode_processor call site: 00000 /src/openjpeg/src/lib/openjp2/t1.c:1677
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:1632
0 8 2 :

['opj_free', 'opj_event_msg']

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

['opj_event_msg']

0 6 opj_j2k_read_unk call site: 00000 /src/openjpeg/src/lib/openjp2/j2k.c:5712
0 6 1 :

['opj_event_msg']

0 6 opj_j2k_read_ppm call site: 00000 /src/openjpeg/src/lib/openjp2/j2k.c:3905
0 6 1 :

['opj_event_msg']

0 6 opj_j2k_read_ppt call site: 00000 /src/openjpeg/src/lib/openjp2/j2k.c:4131

Runtime coverage analysis

Covered functions
323
Functions that are reachable but not covered
40
Reachable functions
101
Percentage of reachable functions covered
60.4%
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 3
src/lib/openjp2/cio.c 11

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 78 34.6%
gold [1:9] 0 0.0%
yellow [10:29] 2 0.88%
greenyellow [30:49] 2 0.88%
lawngreen 50+ 143 63.5%
All colors 225 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
249 249 1 :

['opj_j2k_create_compress']

249 436 opj_jp2_create call site: 00165 /src/openjpeg/src/lib/openjp2/jp2.c:3151
94 160 3 :

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

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

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

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

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

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

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

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

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

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

['opj_j2k_update_image_dimensions']

0 4361 opj_j2k_decode call site: 00000 /src/openjpeg/src/lib/openjp2/j2k.c:12004
0 15 2 :

['opj_t1_destroy', 'opj_event_msg']

0 17 opj_t1_clbl_decode_processor call site: 00000 /src/openjpeg/src/lib/openjp2/t1.c:1677
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:1632
0 8 2 :

['opj_free', 'opj_event_msg']

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

['opj_event_msg']

0 6 opj_j2k_read_unk call site: 00000 /src/openjpeg/src/lib/openjp2/j2k.c:5712
0 6 1 :

['opj_event_msg']

0 6 opj_j2k_read_ppm call site: 00000 /src/openjpeg/src/lib/openjp2/j2k.c:3905

Runtime coverage analysis

Covered functions
343
Functions that are reachable but not covered
38
Reachable functions
101
Percentage of reachable functions covered
62.38%
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 3
src/lib/openjp2/cio.c 11

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 ['struct.opj_jp2 *', 'struct.opj_stream_private *', 'struct.opj_image *', 'struct.opj_event_mgr *'] 9 0 38 8 4 252 0 4458 4372
opj_jp2_encode /src/openjpeg/src/lib/openjp2/jp2.c 3 ['struct.opj_jp2 *', 'struct.opj_stream_private *', 'struct.opj_event_mgr *'] 9 0 17 3 2 188 0 1871 1359
opj_jp2_setup_encoder /src/openjpeg/src/lib/openjp2/jp2.c 4 ['struct.opj_jp2 *', 'struct.opj_cparameters *', 'struct.opj_image *', 'struct.opj_event_mgr *'] 3 0 698 115 46 33 0 518 485
opj_jp2_start_compress /src/openjpeg/src/lib/openjp2/jp2.c 4 ['struct.opj_jp2 *', 'struct.opj_stream_private *', 'struct.opj_image *', 'struct.opj_event_mgr *'] 4 0 60 12 6 102 0 577 402
opj_jp2_read_header /src/openjpeg/src/lib/openjp2/jp2.c 4 ['struct.opj_stream_private *', 'struct.opj_jp2 *', 'struct.opj_image **', 'struct.opj_event_mgr *'] 4 0 146 31 15 47 0 308 168
jp2_dump /src/openjpeg/src/lib/openjp2/jp2.c 3 ['struct.opj_jp2 *', 'int ', 'struct._IO_FILE *'] 2 0 17 3 2 9 0 64 64
opj_j2k_read_siz /src/openjpeg/src/lib/openjp2/j2k.c 4 ['struct.opj_j2k *', 'char *', 'int ', 'struct.opj_event_mgr *'] 1 0 703 114 48 12 0 90 52
opj_jp2_get_tile /src/openjpeg/src/lib/openjp2/jp2.c 5 ['struct.opj_jp2 *', 'struct.opj_stream_private *', 'struct.opj_image *', 'struct.opj_event_mgr *', 'int '] 9 0 40 8 4 253 0 4446 50
opj_j2k_read_cod /src/openjpeg/src/lib/openjp2/j2k.c 4 ['struct.opj_j2k *', 'char *', 'int ', 'struct.opj_event_mgr *'] 2 0 265 42 17 5 0 67 47
opj_jp2_end_compress /src/openjpeg/src/lib/openjp2/jp2.c 3 ['struct.opj_jp2 *', 'struct.opj_stream_private *', 'struct.opj_event_mgr *'] 3 0 41 8 4 30 0 139 43

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

Functions statically reachable by fuzzers
81.0%
525 / 652
Cyclomatic complexity statically reachable by fuzzers
91.0%
7359 / 8112

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/t1.c [] []
/src/openjpeg/src/lib/openjp2/opj_malloc.c ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2'] ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2']
/src/openjpeg/src/lib/openjp2/tcd.c ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2'] ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2']
/src/openjpeg/src/lib/openjp2/image.c ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2'] ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2']
/src/openjpeg/src/lib/openjp2/dwt.c [] []
/src/openjpeg/src/lib/openjp2/opj_intmath.h [] []
/src/openjpeg/src/lib/openjp2/mct.c [] []
/src/openjpeg/src/lib/openjp2/mqc_inl.h [] []
/src/openjpeg/src/lib/openjp2/ht_dec.c [] []
/src/openjpeg/src/lib/openjp2/sparse_array.c [] []
/src/openjpeg/src/lib/openjp2/event.c ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2'] ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2']
/src/openjpeg/src/lib/openjp2/j2k.c ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2'] ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2']
/src/openjpeg/src/lib/openjp2/function_list.c ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2'] ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2']
/src/openjpeg/src/lib/openjp2/bio.c [] []
/src/openjpeg/src/lib/openjp2/openjpeg.c ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2'] ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2']
/src/openjpeg/src/lib/openjp2/pi.c [] []
/src/openjpeg/src/lib/openjp2/invert.c [] []
/src/openjpeg/./tests/fuzzers/opj_decompress_fuzzer_JP2.cpp ['opj_decompress_fuzzer_JP2'] []
/src/openjpeg/src/lib/openjp2/mqc.c [] []
/src/openjpeg/./tests/fuzzers/opj_decompress_fuzzer_J2K.cpp ['opj_decompress_fuzzer_J2K'] []
/src/openjpeg/src/lib/openjp2/opj_includes.h [] []
/src/openjpeg/src/lib/openjp2/jp2.c ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2'] ['opj_decompress_fuzzer_JP2']
/usr/include/stdlib.h ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2'] []
/src/openjpeg/src/lib/openjp2/cio.c ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2'] ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2']
/src/openjpeg/src/lib/openjp2/t2.c [] []
/src/openjpeg/src/lib/openjp2/tgt.c ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2'] ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2']
/src/openjpeg/src/lib/openjp2/thread.c ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2'] ['opj_decompress_fuzzer_J2K', 'opj_decompress_fuzzer_JP2']

Directories in report

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