From a05001ade3a61981861b189cdb3a98d78a1e865c Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 15 Mar 2024 21:32:54 +0000 Subject: [PATCH] zlib: sync with src --- sys/lib/libz/deflate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/lib/libz/deflate.c b/sys/lib/libz/deflate.c index 598d5a2b2ad..e653d530c51 100644 --- a/sys/lib/libz/deflate.c +++ b/sys/lib/libz/deflate.c @@ -842,13 +842,13 @@ uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen) { storelen = sourceLen + (sourceLen >> 5) + (sourceLen >> 7) + (sourceLen >> 11) + 7; - /* if can't get parameters, return larger bound plus a zlib wrapper */ + /* if can't get parameters, return larger bound plus a wrapper */ if (deflateStateCheck(strm)) - return (fixedlen > storelen ? fixedlen : storelen) + 6; + return (fixedlen > storelen ? fixedlen : storelen) + 18; /* compute wrapper length */ s = strm->state; - switch (s->wrap) { + switch (s->wrap < 0 ? -s->wrap : s->wrap) { case 0: /* raw deflate */ wraplen = 0; break; @@ -878,7 +878,7 @@ uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen) { break; #endif default: /* for compiler happiness */ - wraplen = 6; + wraplen = 18; } /* if not default parameters, return one of the conservative bounds */ -- 2.20.1