Skip to content

Commit

Permalink
Generate zlib CRC tables in case compiled with dynamic tables.
Browse files Browse the repository at this point in the history
It is possible that the zlib being used was compiled with dynamic
CRC tables, i.e. with DYNAMIC_CRC_TABLE defined. In that case, the
tables must be generated before multiple threads can be allowed to
compute CRCs. The get_crc_table() function forces that generation.
  • Loading branch information
madler committed Dec 26, 2018
1 parent 45a6a12 commit e846692
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pigz.c
Expand Up @@ -4343,6 +4343,9 @@ int main(int argc, char **argv) {
if (zlib_vernum() < 0x1230)
throw(EINVAL, "zlib version less than 1.2.3");

// create CRC table, in case zlib compiled with dynamic tables
get_crc_table();

// process user environment variable defaults in GZIP
opts = getenv("GZIP");
if (opts != NULL) {
Expand Down

0 comments on commit e846692

Please sign in to comment.