All tests should give some portion of data to the producer and use the rest.
This commit is contained in:
@@ -52,9 +52,13 @@ static size_t roundTripTest(void *result, size_t resultCapacity,
|
||||
|
||||
int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size)
|
||||
{
|
||||
/* Give a random portion of src data to the producer, to use for
|
||||
parameter generation. The rest will be used for (de)compression */
|
||||
FUZZ_dataProducer_t *producer = FUZZ_dataProducer_create(src, size);
|
||||
size_t producerSliceSize = FUZZ_dataProducer_uint32Range(producer, 0, size);
|
||||
size = FUZZ_dataProducer_contract(producer, producerSliceSize);
|
||||
|
||||
int cLevel = FUZZ_dataProducer_uint32(producer) % kMaxClevel;
|
||||
size = FUZZ_dataProducer_remainingBytes(producer);
|
||||
|
||||
size_t neededBufSize = size;
|
||||
if (size > ZSTD_BLOCKSIZE_MAX)
|
||||
|
||||
Reference in New Issue
Block a user