summaryrefslogtreecommitdiffstats
path: root/ossfuzz/compress_hc_fuzzer.c
diff options
context:
space:
mode:
Diffstat (limited to 'ossfuzz/compress_hc_fuzzer.c')
-rw-r--r--ossfuzz/compress_hc_fuzzer.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ossfuzz/compress_hc_fuzzer.c b/ossfuzz/compress_hc_fuzzer.c
index fac5e6f..7d8e45a 100644
--- a/ossfuzz/compress_hc_fuzzer.c
+++ b/ossfuzz/compress_hc_fuzzer.c
@@ -17,12 +17,10 @@
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
FUZZ_dataProducer_t *producer = FUZZ_dataProducer_create(data, size);
- size_t const dstCapacitySeed = FUZZ_dataProducer_uint32(producer,
- 0, LZ4_compressBound(size));
- size_t const levelSeed = FUZZ_dataProducer_uint32(producer,
- LZ4HC_CLEVEL_MIN, LZ4HC_CLEVEL_MAX);
-
+ size_t const dstCapacitySeed = FUZZ_dataProducer_retrieve32(producer);
+ size_t const levelSeed = FUZZ_dataProducer_retrieve32(producer);
size = FUZZ_dataProducer_remainingBytes(producer);
+
size_t const dstCapacity = FUZZ_getRange_from_uint32(dstCapacitySeed, 0, size);
int const level = FUZZ_getRange_from_uint32(levelSeed, LZ4HC_CLEVEL_MIN, LZ4HC_CLEVEL_MAX);