aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/crc32.c2
-rw-r--r--lib/inflate.c16
-rw-r--r--lib/zlib_inflate/inftrees.c2
3 files changed, 11 insertions, 9 deletions
diff --git a/lib/crc32.c b/lib/crc32.c
index 58b222783f9c..065198f98b3f 100644
--- a/lib/crc32.c
+++ b/lib/crc32.c
@@ -473,7 +473,7 @@ static u32 test_step(u32 init, unsigned char *buf, size_t len)
473 init = bitreverse(init); 473 init = bitreverse(init);
474 crc2 = bitreverse(crc1); 474 crc2 = bitreverse(crc1);
475 if (crc1 != bitreverse(crc2)) 475 if (crc1 != bitreverse(crc2))
476 printf("\nBit reversal fail: 0x%08x -> %0x08x -> 0x%08x\n", 476 printf("\nBit reversal fail: 0x%08x -> 0x%08x -> 0x%08x\n",
477 crc1, crc2, bitreverse(crc2)); 477 crc1, crc2, bitreverse(crc2));
478 crc1 = crc32_le(init, buf, len); 478 crc1 = crc32_le(init, buf, len);
479 if (crc1 != crc2) 479 if (crc1 != crc2)
diff --git a/lib/inflate.c b/lib/inflate.c
index 75e7d303c72e..6db6e98d1637 100644
--- a/lib/inflate.c
+++ b/lib/inflate.c
@@ -326,7 +326,7 @@ DEBG("huft1 ");
326 { 326 {
327 *t = (struct huft *)NULL; 327 *t = (struct huft *)NULL;
328 *m = 0; 328 *m = 0;
329 return 0; 329 return 2;
330 } 330 }
331 331
332DEBG("huft2 "); 332DEBG("huft2 ");
@@ -374,6 +374,7 @@ DEBG("huft5 ");
374 if ((j = *p++) != 0) 374 if ((j = *p++) != 0)
375 v[x[j]++] = i; 375 v[x[j]++] = i;
376 } while (++i < n); 376 } while (++i < n);
377 n = x[g]; /* set n to length of v */
377 378
378DEBG("h6 "); 379DEBG("h6 ");
379 380
@@ -410,12 +411,13 @@ DEBG1("1 ");
410DEBG1("2 "); 411DEBG1("2 ");
411 f -= a + 1; /* deduct codes from patterns left */ 412 f -= a + 1; /* deduct codes from patterns left */
412 xp = c + k; 413 xp = c + k;
413 while (++j < z) /* try smaller tables up to z bits */ 414 if (j < z)
414 { 415 while (++j < z) /* try smaller tables up to z bits */
415 if ((f <<= 1) <= *++xp) 416 {
416 break; /* enough codes to use up j bits */ 417 if ((f <<= 1) <= *++xp)
417 f -= *xp; /* else deduct codes from patterns */ 418 break; /* enough codes to use up j bits */
418 } 419 f -= *xp; /* else deduct codes from patterns */
420 }
419 } 421 }
420DEBG1("3 "); 422DEBG1("3 ");
421 z = 1 << j; /* table entries for j-bit table */ 423 z = 1 << j; /* table entries for j-bit table */
diff --git a/lib/zlib_inflate/inftrees.c b/lib/zlib_inflate/inftrees.c
index 874950ec4858..c5f66fbb0dd0 100644
--- a/lib/zlib_inflate/inftrees.c
+++ b/lib/zlib_inflate/inftrees.c
@@ -141,7 +141,7 @@ static int huft_build(
141 { 141 {
142 *t = NULL; 142 *t = NULL;
143 *m = 0; 143 *m = 0;
144 return Z_OK; 144 return Z_DATA_ERROR;
145 } 145 }
146 146
147 147