Limit max number of threads in case of fuzzing

Fuzzing with memory sanitizer gave out-of-memory failures
This commit is contained in:
Martijn van Beurden 2023-07-26 21:37:18 +02:00
parent c1f0eb4bea
commit e0ebc8eb7e
1 changed files with 5 additions and 0 deletions

View File

@ -42,8 +42,13 @@
* accumulator in the *precompute_partition_info_sums_* functions.
*/
#define FLAC__MAX_EXTRA_RESIDUAL_BPS 4
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
#define FLAC__STREAM_ENCODER_MAX_THREADS 16
#define FLAC__STREAM_ENCODER_MAX_THREADTASKS 34
#else
#define FLAC__STREAM_ENCODER_MAX_THREADS 64
#define FLAC__STREAM_ENCODER_MAX_THREADTASKS 130
#endif
#if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && defined FLAC__HAS_X86INTRIN
#include "private/cpu.h"