aboutsummaryrefslogtreecommitdiff
path: root/trees.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:20:07 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:20:07 -0700
commit02b6cf579f02ec78c052735020a5d3c5723ed641 (patch)
tree6241259561d6def69639f52836675481f61105a0 /trees.c
parent965fe72aed580d518c979c9a33b49e7df28205f7 (diff)
downloadzlib-02b6cf579f02ec78c052735020a5d3c5723ed641.tar.gz
zlib-02b6cf579f02ec78c052735020a5d3c5723ed641.tar.bz2
zlib-02b6cf579f02ec78c052735020a5d3c5723ed641.zip
zlib 1.1.1v1.1.1
Diffstat (limited to 'trees.c')
-rw-r--r--trees.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/trees.c b/trees.c
index e09e94c..ef31043 100644
--- a/trees.c
+++ b/trees.c
@@ -1042,8 +1042,9 @@ int _tr_tally (s, dist, lc)
1042 s->dyn_dtree[d_code(dist)].Freq++; 1042 s->dyn_dtree[d_code(dist)].Freq++;
1043 } 1043 }
1044 1044
1045#ifdef TRUNCATE_BLOCK
1045 /* Try to guess if it is profitable to stop the current block here */ 1046 /* Try to guess if it is profitable to stop the current block here */
1046 if (s->level > 2 && (s->last_lit & 0xfff) == 0) { 1047 if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
1047 /* Compute an upper bound for the compressed length */ 1048 /* Compute an upper bound for the compressed length */
1048 ulg out_length = (ulg)s->last_lit*8L; 1049 ulg out_length = (ulg)s->last_lit*8L;
1049 ulg in_length = (ulg)((long)s->strstart - s->block_start); 1050 ulg in_length = (ulg)((long)s->strstart - s->block_start);
@@ -1058,6 +1059,7 @@ int _tr_tally (s, dist, lc)
1058 100L - out_length*100L/in_length)); 1059 100L - out_length*100L/in_length));
1059 if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1; 1060 if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
1060 } 1061 }
1062#endif
1061 return (s->last_lit == s->lit_bufsize-1); 1063 return (s->last_lit == s->lit_bufsize-1);
1062 /* We avoid equality with lit_bufsize because of wraparound at 64K 1064 /* We avoid equality with lit_bufsize because of wraparound at 64K
1063 * on 16 bit machines and because stored blocks are restricted to 1065 * on 16 bit machines and because stored blocks are restricted to