~sircmpwn/hare-compress

159eb2b05ee853eeb1916cd5adf3aa883bcbebe6 — Lassi Pulkkinen 1 year, 3 months ago 40f898d
compress::deflate: Fix < 0 check on unsigned int

Signed-off-by: Lassi Pulkkinen <lassi@pulk.fi>
1 files changed, 1 insertions(+), 1 deletions(-)

M compress/flate/inflate.ha
M compress/flate/inflate.ha => compress/flate/inflate.ha +1 -1
@@ 192,8 192,8 @@ fn construct(h: *huffman, lens: []u16) (void | io::error) = {

	for (let left = 1z, i = 1z; i <= MAXBITS; i += 1) {
		left <<= 1;
		if (left < h.counts[i]) return wraperror(inflate_err::HUFFMAN);
		left -= h.counts[i];
		if (left < 0) return wraperror(inflate_err::HUFFMAN);
	};

	let offs: [MAXBITS + 1]u16 = [0...];