struct Match defermatch, matches[MAXMATCH];
int deferchr;
+ assert(st->npending <= HASHCHARS);
+
/*
* Add any pending characters from last time to the window. (We
* might not be able to.)
+ *
+ * This leaves st->pending empty in the usual case (when len >=
+ * HASHCHARS); otherwise it leaves st->pending empty enough that
+ * adding all the remaining 'len' characters will not push it past
+ * HASHCHARS in size.
*/
for (i = 0; i < st->npending; i++) {
unsigned char foo[HASHCHARS];
if (len >= HASHCHARS) {
lz77_advance(st, *data, lz77_hash(data));
} else {
+ assert(st->npending < HASHCHARS);
st->pending[st->npending++] = *data;
}
data++;
goto finished;
if (code == -2)
goto decode_error;
+ if (code >= 30) /* dist symbols 30 and 31 are invalid */
+ goto decode_error;
dctx->state = GOTDISTSYM;
dctx->sym = code;
break;