--- zlib-1.2.3.3/inftrees.c.original 2006-09-17 16:53:11.000000000 -0400 +++ zlib-1.2.3.3/inftrees.c 2007-11-20 11:56:21.000000000 -0500 @@ -57,6 +57,7 @@ int end; /* use base and extra for symbol > end */ unsigned short count[MAXBITS+1]; /* number of codes of each length */ unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ + static const code invalid_code = { 64, 1, 0 }; static const unsigned short lbase[31] = { /* Length codes 257..285 base */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; @@ -115,11 +116,9 @@ if (count[max] != 0) break; if (root > max) root = max; if (max == 0) { /* no symbols to code at all */ - here.op = (unsigned char)64; /* invalid code marker */ - here.bits = (unsigned char)1; - here.val = (unsigned short)0; - *(*table)++ = here; /* make a table to force an error */ - *(*table)++ = here; + code FAR * const t = *table; /* single deref of **code[] ptr */ + t[0] = t[1] = invalid_code; /* make a table to force an error */ + (*table) += 2; /* advance ptr past invalid markers */ *bits = 1; return 0; /* no symbols, but wait for decoding to report error */ }