diff options
author | Martijn van Beurden <mvanb1@gmail.com> | 2022-10-11 07:24:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-11 07:24:47 +0200 |
commit | 09660e58dd16f3339cbd7e28e80552288c8bf50b (patch) | |
tree | 3174c046007d43ce39d1145ece43bf44833413ea /oss-fuzz | |
parent | ce5d41fa960f6a5bbba01c834805fe1daa7d90d5 (diff) | |
download | flac-09660e58dd16f3339cbd7e28e80552288c8bf50b.tar.gz |
Reduce timeouts of fuzzer_encoder similar to fuzzer_encoder_v2
Diffstat (limited to 'oss-fuzz')
-rw-r--r-- | oss-fuzz/fuzzer_encoder.cc | 11 | ||||
-rw-r--r-- | oss-fuzz/fuzzer_encoder_v2.cc | 4 |
2 files changed, 13 insertions, 2 deletions
diff --git a/oss-fuzz/fuzzer_encoder.cc b/oss-fuzz/fuzzer_encoder.cc index ceaabbb4..b4f25ec7 100644 --- a/oss-fuzz/fuzzer_encoder.cc +++ b/oss-fuzz/fuzzer_encoder.cc @@ -139,6 +139,17 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { fuzzing::memory::memory_test(res); } + if ( size > 2 * 65535 ) { + /* With large inputs and expensive options enabled, the fuzzer can get *really* slow. + * Some combinations can make the fuzzer timeout (>60 seconds). However, while combining + * options makes the fuzzer slower, most options do not expose new code when combined. + * Therefore, combining slow options is disabled for large inputs. Any input containing + * more than 65536 * 2 samples (max blocksize, stereo) is considered large + */ + encoder.set_do_qlp_coeff_prec_search(false); + encoder.set_do_exhaustive_model_search(false); + } + { ::FLAC__StreamEncoderInitStatus ret; if ( !use_ogg ) { diff --git a/oss-fuzz/fuzzer_encoder_v2.cc b/oss-fuzz/fuzzer_encoder_v2.cc index 0970f6bc..44d3f984 100644 --- a/oss-fuzz/fuzzer_encoder_v2.cc +++ b/oss-fuzz/fuzzer_encoder_v2.cc @@ -148,8 +148,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) encoder_valid &= FLAC__stream_encoder_set_max_residual_partition_order(encoder, max_residual_partition_order); } else { - if(data_bools[4]) - encoder_valid &= FLAC__stream_encoder_set_streamable_subset(encoder, true); + if(!data_bools[4]) + encoder_valid &= FLAC__stream_encoder_set_streamable_subset(encoder, false); else if(data_bools[6]) encoder_valid &= FLAC__stream_encoder_set_do_escape_coding(encoder, true); else if(data_bools[7]) |