From 928e6398a2d0c34d6a95658932ec7f29b2e895b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Podg=C3=B3rski?= Date: Tue, 28 Nov 2023 18:39:15 +0100 Subject: [PATCH] Update miniz.h --- src/miniz.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/miniz.h b/src/miniz.h index 6d32e58b..eb8cf17e 100644 --- a/src/miniz.h +++ b/src/miniz.h @@ -2144,7 +2144,7 @@ mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len) { } int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, - const unsigned char *pSource, mz_ulong source_len, int level) { + const unsigned char *pSource, mz_ulong pSource_len, int level) { int status; mz_stream stream; memset(&stream, 0, sizeof(stream)); @@ -2152,12 +2152,12 @@ int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, #if defined(__MINGW32__) || defined(__MINGW64__) || defined(__WATCOMC__) /* In case mz_ulong is 64-bits (argh I hate longs). */ #else - if ((mz_uint64)(source_len | *pDest_len) > 0xFFFFFFFFU) + if ((mz_uint64)(pSource_len | *pDest_len) > 0xFFFFFFFFU) return MZ_PARAM_ERROR; #endif stream.next_in = pSource; - stream.avail_in = (mz_uint32)source_len; + stream.avail_in = (mz_uint32)pSource_len; stream.next_out = pDest; stream.avail_out = (mz_uint32)*pDest_len; @@ -2401,9 +2401,12 @@ int mz_uncompress2(unsigned char *pDest, mz_ulong *pDest_len, int status; memset(&stream, 0, sizeof(stream)); +#if defined(__MINGW32__) || defined(__MINGW64__) || defined(__WATCOMC__) /* In case mz_ulong is 64-bits (argh I hate longs). */ +#else if ((mz_uint64)(*pSource_len | *pDest_len) > 0xFFFFFFFFU) return MZ_PARAM_ERROR; +#endif stream.next_in = pSource; stream.avail_in = (mz_uint32)*pSource_len;