aboutsummaryrefslogtreecommitdiff
path: root/trees.c
diff options
context:
space:
mode:
Diffstat (limited to 'trees.c')
-rw-r--r--trees.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/trees.c b/trees.c
index 72b521f..340173c 100644
--- a/trees.c
+++ b/trees.c
@@ -950,7 +950,10 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
950 opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, 950 opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
951 s->sym_next / 3)); 951 s->sym_next / 3));
952 952
953 if (static_lenb <= opt_lenb) opt_lenb = static_lenb; 953#ifndef FORCE_STATIC
954 if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
955#endif
956 opt_lenb = static_lenb;
954 957
955 } else { 958 } else {
956 Assert(buf != (char*)0, "lost buf"); 959 Assert(buf != (char*)0, "lost buf");
@@ -971,11 +974,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
971 */ 974 */
972 _tr_stored_block(s, buf, stored_len, last); 975 _tr_stored_block(s, buf, stored_len, last);
973 976
974#ifdef FORCE_STATIC 977 } else if (static_lenb == opt_lenb) {
975 } else if (static_lenb >= 0) { /* force static trees */
976#else
977 } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
978#endif
979 send_bits(s, (STATIC_TREES<<1)+last, 3); 978 send_bits(s, (STATIC_TREES<<1)+last, 3);
980 compress_block(s, (const ct_data *)static_ltree, 979 compress_block(s, (const ct_data *)static_ltree,
981 (const ct_data *)static_dtree); 980 (const ct_data *)static_dtree);