X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=include%2Fwimlib%2Fhc_matchfinder.h;h=dd1cfab9dcde44df3005913e95d636db8411a3c5;hp=1403a15781039a49f0400e4789ecde9667f7b261;hb=1855a4637636e8b00ff30fdbee6d2628de73381a;hpb=3e8aa757aaa63297f0d54007adf46411778fb6a8 diff --git a/include/wimlib/hc_matchfinder.h b/include/wimlib/hc_matchfinder.h index 1403a157..dd1cfab9 100644 --- a/include/wimlib/hc_matchfinder.h +++ b/include/wimlib/hc_matchfinder.h @@ -145,8 +145,9 @@ hc_matchfinder_init(struct hc_matchfinder *mf) * The maximum permissible match length at this position. * @nice_len * Stop searching if a match of at least this length is found. + * Must be <= @max_len. * @max_search_depth - * Limit on the number of potential matches to consider. + * Limit on the number of potential matches to consider. Must be >= 1. * @offset_ret * If a match is found, its offset is returned in this location. * @@ -172,7 +173,7 @@ hc_matchfinder_longest_match(struct hc_matchfinder * const restrict mf, pos_t cur_node; /* Insert the current sequence into the appropriate linked list. */ - if (unlikely(max_len < LZ_HASH_REQUIRED_NBYTES)) + if (unlikely(max_len < LOAD_U24_REQUIRED_NBYTES)) goto out; first_3_bytes = load_u24_unaligned(in_next); hash = lz_hash(first_3_bytes, HC_MATCHFINDER_HASH_ORDER); @@ -278,7 +279,7 @@ hc_matchfinder_skip_positions(struct hc_matchfinder * restrict mf, { u32 hash; - if (unlikely(in_next + count >= in_end - LZ_HASH_REQUIRED_NBYTES)) + if (unlikely(in_next + count >= in_end - LZ_HASH3_REQUIRED_NBYTES)) return; do {