Only fuzz apodizations on small inputs (#479)

This commit is contained in:
Martijn van Beurden 2022-10-12 16:58:03 +02:00 committed by GitHub
parent 09660e58dd
commit f64f3782f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -139,16 +139,22 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
fuzzing::memory::memory_test(res); fuzzing::memory::memory_test(res);
} }
if ( size > 2 * 65535 ) { if ( size > 2 * 65535 * 4 ) {
/* With large inputs and expensive options enabled, the fuzzer can get *really* slow. /* 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 * 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. * 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 * Therefore, combining slow options is disabled for large inputs. Any input containing
* more than 65536 * 2 samples (max blocksize, stereo) is considered large * more than 65536 * 2 samples of 32 bits each (max blocksize, stereo) is considered large
*/ */
encoder.set_do_qlp_coeff_prec_search(false); encoder.set_do_qlp_coeff_prec_search(false);
encoder.set_do_exhaustive_model_search(false); encoder.set_do_exhaustive_model_search(false);
} }
if ( size > 2 * 4096 * 4 + 250 ) {
/* With subdivide_tukey in the mix testing apodizations can get really expensive. Therefore
* this is disabled for inputs of more than one whole stereo block of 32-bit inputs plus a
* bit of overhead */
encoder.set_apodization("");
}
{ {
::FLAC__StreamEncoderInitStatus ret; ::FLAC__StreamEncoderInitStatus ret;