diff -ru optipng-0.4.8.orig/lib/zlib/inftrees.c optipng-0.4.8/lib/zlib/inftrees.c --- optipng-0.4.8.orig/lib/zlib/inftrees.c 2004-09-15 15:30:06.000000000 +0100 +++ optipng-0.4.8/lib/zlib/inftrees.c 2005-10-07 17:13:03.069420200 +0100 @@ -134,7 +134,7 @@ left -= count[len]; if (left < 0) return -1; /* over-subscribed */ } - if (left > 0 && (type == CODES || (codes - count[0] != 1))) + if (left > 0 && (type == CODES || max != 1)) return -1; /* incomplete set */ /* generate offsets into symbol table for each length for sorting */ diff -ru optipng-0.4.8.orig/lib/zlib/inftrees.h optipng-0.4.8/lib/zlib/inftrees.h --- optipng-0.4.8.orig/lib/zlib/inftrees.h 2003-08-10 23:15:50.000000000 +0100 +++ optipng-0.4.8/lib/zlib/inftrees.h 2005-10-07 17:13:49.953292768 +0100 @@ -36,12 +36,12 @@ */ /* Maximum size of dynamic tree. The maximum found in a long but non- - exhaustive search was 1004 code structures (850 for length/literals - and 154 for distances, the latter actually the result of an + exhaustive search was 1444 code structures (852 for length/literals + and 592 for distances, the latter actually the result of an exhaustive search). The true maximum is not known, but the value below is more than safe. */ -#define ENOUGH 1440 -#define MAXD 154 +#define ENOUGH 2048 +#define MAXD 592 /* Type of code to build for inftable() */ typedef enum {