1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00

Combining fuzz_data_producer restrict calls into a single function

This commit is contained in:
Dario Pavlovic
2019-09-11 10:09:29 -07:00
parent 23cc2d8510
commit b5b24c2a0d
10 changed files with 22 additions and 20 deletions

View File

@ -26,8 +26,7 @@ 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);
size = FUZZ_dataProducer_reserveDataPrefix(producer);
if (!dctx) {
dctx = ZSTD_createDCtx();