summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn van Beurden <mvanb1@gmail.com>2022-10-12 16:58:03 +0200
committerGitHub <noreply@github.com>2022-10-12 16:58:03 +0200
commitf64f3782f07089ce0e0e5c523a33c5aafb34fd24 (patch)
tree422158e411c029f0c9f9364b4d1cb50d2aa638b9
parent09660e58dd16f3339cbd7e28e80552288c8bf50b (diff)
downloadflac-f64f3782f07089ce0e0e5c523a33c5aafb34fd24.tar.gz
Only fuzz apodizations on small inputs (#479)
-rw-r--r--oss-fuzz/fuzzer_encoder.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/oss-fuzz/fuzzer_encoder.cc b/oss-fuzz/fuzzer_encoder.cc
index b4f25ec7..6d230122 100644
--- a/oss-fuzz/fuzzer_encoder.cc
+++ b/oss-fuzz/fuzzer_encoder.cc
@@ -139,16 +139,22 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
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.
* 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
+ * 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_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;