diff options
Diffstat (limited to 'ossfuzz/round_trip_hc_fuzzer.c')
-rw-r--r-- | ossfuzz/round_trip_hc_fuzzer.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ossfuzz/round_trip_hc_fuzzer.c b/ossfuzz/round_trip_hc_fuzzer.c index 8406809..cc9c302 100644 --- a/ossfuzz/round_trip_hc_fuzzer.c +++ b/ossfuzz/round_trip_hc_fuzzer.c @@ -16,11 +16,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { FUZZ_dataProducer_t *producer = FUZZ_dataProducer_create(data, size); - size_t const dstCapacity = LZ4_compressBound(size); + int const level = FUZZ_dataProducer_uint32NonAdaptive(producer, + LZ4HC_CLEVEL_MIN, LZ4HC_CLEVEL_MAX); + size_t const dstCapacity = LZ4_compressBound( + FUZZ_dataProducer_remainingBytes(producer)); char* const dst = (char*)malloc(dstCapacity); char* const rt = (char*)malloc(size); - int const level = FUZZ_dataProducer_uint32( - producer, LZ4HC_CLEVEL_MIN, LZ4HC_CLEVEL_MAX); /* Restrict to remaining data from producer */ size = FUZZ_dataProducer_remainingBytes(producer); |