From 81c41dd5c5ddfff868d8d394fc21fdfa4e55de92 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Mon, 9 Feb 2026 07:06:18 -0800 Subject: Fix the usage of types in deflate.c for when an int is 16 bits. Also clean up conversion warnings. --- zlib.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'zlib.h') diff --git a/zlib.h b/zlib.h index afa3d5a9..8ffc8de8 100644 --- a/zlib.h +++ b/zlib.h @@ -795,7 +795,10 @@ ZEXTERN int ZEXPORT deflatePending(z_streamp strm, or bits are Z_NULL, then those values are not set. deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. + stream state was inconsistent. If an int is 16 bits and memLevel is 9, then + it is possible for the number of pending bytes to not fit in an unsigned. In + that case Z_BUF_ERROR is returned and *pending is set to the maximum value + of an unsigned. */ ZEXTERN int ZEXPORT deflateUsed(z_streamp strm, -- cgit v1.2.3-55-g6feb