From 580a777adebff2afaf19cf1af11e11e1a1cfc78d Mon Sep 17 00:00:00 2001 From: yixy-only Date: Sat, 16 Aug 2025 16:41:29 +0800 Subject: [PATCH] [sdefl] Fix bug where some members of struct sdefl are not initialized --- sdefl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdefl.h b/sdefl.h index 5d5bcd0..8df367e 100644 --- a/sdefl.h +++ b/sdefl.h @@ -673,6 +673,9 @@ sdefl_compr(struct sdefl *s, unsigned char *out, const unsigned char *in, for (n = 0; n < SDEFL_HASH_SIZ; ++n) { s->tbl[n] = SDEFL_NIL; } + s->seq_cnt = 0; + memset(&s->freq, 0, sizeof(sdefl_freq)); + do {int blk_begin = i; int blk_end = ((i + SDEFL_BLK_MAX) < in_len) ? (i + SDEFL_BLK_MAX) : in_len; while (i < blk_end) {