From fb0b09ba3e2c3c908734a21a56191b80c1286149 Mon Sep 17 00:00:00 2001 From: Tim Yamin Date: Mon, 25 Jul 2005 23:16:13 +0100 Subject: [PATCH] --- yaml --- r: 5676 b: refs/heads/master c: 4aad724d3e52238e1ce005f166fbba5b4072a7f6 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/ppc64/boot/zlib.c | 3 ++- trunk/lib/inflate.c | 16 +++++++++------- trunk/lib/zlib_inflate/inftrees.c | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 25533e78f674..9735ec7a5f18 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 00a5dfdb93f74e4d95fb0d83c890728e331f8810 +refs/heads/master: 4aad724d3e52238e1ce005f166fbba5b4072a7f6 diff --git a/trunk/arch/ppc64/boot/zlib.c b/trunk/arch/ppc64/boot/zlib.c index 9d5e4e9832d2..78837e884b8b 100644 --- a/trunk/arch/ppc64/boot/zlib.c +++ b/trunk/arch/ppc64/boot/zlib.c @@ -1307,7 +1307,7 @@ local int huft_build( { *t = (inflate_huft *)Z_NULL; *m = 0; - return Z_OK; + return Z_DATA_ERROR; } @@ -1351,6 +1351,7 @@ local int huft_build( if ((j = *p++) != 0) v[x[j]++] = i; } while (++i < n); + n = x[g]; /* set n to length of v */ /* Generate the Huffman codes and for each, make the table entries */ diff --git a/trunk/lib/inflate.c b/trunk/lib/inflate.c index 75e7d303c72e..6db6e98d1637 100644 --- a/trunk/lib/inflate.c +++ b/trunk/lib/inflate.c @@ -326,7 +326,7 @@ DEBG("huft1 "); { *t = (struct huft *)NULL; *m = 0; - return 0; + return 2; } DEBG("huft2 "); @@ -374,6 +374,7 @@ DEBG("huft5 "); if ((j = *p++) != 0) v[x[j]++] = i; } while (++i < n); + n = x[g]; /* set n to length of v */ DEBG("h6 "); @@ -410,12 +411,13 @@ DEBG1("1 "); DEBG1("2 "); f -= a + 1; /* deduct codes from patterns left */ xp = c + k; - while (++j < z) /* try smaller tables up to z bits */ - { - if ((f <<= 1) <= *++xp) - break; /* enough codes to use up j bits */ - f -= *xp; /* else deduct codes from patterns */ - } + if (j < z) + while (++j < z) /* try smaller tables up to z bits */ + { + if ((f <<= 1) <= *++xp) + break; /* enough codes to use up j bits */ + f -= *xp; /* else deduct codes from patterns */ + } } DEBG1("3 "); z = 1 << j; /* table entries for j-bit table */ diff --git a/trunk/lib/zlib_inflate/inftrees.c b/trunk/lib/zlib_inflate/inftrees.c index 874950ec4858..c5f66fbb0dd0 100644 --- a/trunk/lib/zlib_inflate/inftrees.c +++ b/trunk/lib/zlib_inflate/inftrees.c @@ -141,7 +141,7 @@ static int huft_build( { *t = NULL; *m = 0; - return Z_OK; + return Z_DATA_ERROR; }