mirror of
https://github.com/intel/isa-l.git
synced 2024-12-13 09:52:56 +01:00
igzip: Fix igzip fuzz test for lev2-3 buf size
Also remove unnecessary deps in igzip makefile. Change-Id: I1ff79461df6d60bfc52c99b574c39098f1fe238a Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
This commit is contained in:
parent
6b1c9a95c8
commit
22ec5c7469
@ -123,6 +123,3 @@ igzip_inflate_test: LDLIBS += -lz
|
||||
igzip_igzip_inflate_test_LDADD = libisal.la
|
||||
igzip_igzip_inflate_test_LDFLAGS = -lz
|
||||
igzip_igzip_hist_perf_LDADD = libisal.la
|
||||
igzip_fuzz_inflate: LDLIBS += -lz
|
||||
igzip_igzip_fuzz_inflate_LDADD = libisal.la
|
||||
igzip_igzip_fuzz_inflate_LDFLAGS = -lz
|
||||
|
@ -55,12 +55,28 @@ int LLVMFuzzerTestOneInput(const uint8_t * data, size_t size)
|
||||
wrapper_type = (in_param & HEADER_BIT_MASK) % (IGZIP_ZLIB_NO_HDR + 1);
|
||||
in_param >>= HEADER_BITS;
|
||||
|
||||
lev_buf_size = (0 == level) ?
|
||||
ISAL_DEF_LVL0_MIN + (in_param) * (ISAL_DEF_LVL0_EXTRA_LARGE /
|
||||
LEVEL_BIT_MASK) :
|
||||
ISAL_DEF_LVL1_MIN + (in_param) * (ISAL_DEF_LVL1_EXTRA_LARGE /
|
||||
LEVEL_BIT_MASK);
|
||||
|
||||
switch (level) {
|
||||
case 0:
|
||||
lev_buf_size = ISAL_DEF_LVL0_MIN + (in_param) *
|
||||
(ISAL_DEF_LVL0_EXTRA_LARGE / LEVEL_BIT_MASK);
|
||||
break;
|
||||
case 1:
|
||||
lev_buf_size = ISAL_DEF_LVL1_MIN + (in_param) *
|
||||
(ISAL_DEF_LVL1_EXTRA_LARGE / LEVEL_BIT_MASK);
|
||||
break;
|
||||
#ifdef ISAL_DEF_LVL2_MIN
|
||||
case 2:
|
||||
lev_buf_size = ISAL_DEF_LVL2_MIN + (in_param) *
|
||||
(ISAL_DEF_LVL2_EXTRA_LARGE / LEVEL_BIT_MASK);
|
||||
break;
|
||||
#endif
|
||||
#ifdef ISAL_DEF_LVL3_MIN
|
||||
case 3:
|
||||
lev_buf_size = ISAL_DEF_LVL3_MIN + (in_param) *
|
||||
(ISAL_DEF_LVL3_EXTRA_LARGE / LEVEL_BIT_MASK);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
if (0 == level)
|
||||
cmp_buf_size = 2 * size + ISAL_DEF_MAX_HDR_SIZE;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user