Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions inflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
case DICT:
if (state->havedict == 0) {
RESTORE();
strm->total_in += in - strm->avail_in;
return Z_NEED_DICT;
}
strm->adler = state->check = adler32(0L, Z_NULL, 0);
Expand Down
5 changes: 5 additions & 0 deletions test/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,11 @@ static void test_dict_inflate(Byte *compr, uLong comprLen, Byte *uncompr,
CHECK_ERR(err, "inflate with dict");
}

if (d_stream.total_in != comprLen - d_stream.avail_in) {
fprintf(stderr, "bad total_in after dictionary inflate\n");
exit(1);
}

err = inflateEnd(&d_stream);
CHECK_ERR(err, "inflateEnd");

Expand Down