Skip to content

Commit

Permalink
Update miniz.h
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-- committed Nov 28, 2023
1 parent 2186c2a commit 928e639
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/miniz.h
Original file line number Diff line number Diff line change
Expand Up @@ -2144,20 +2144,20 @@ 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));

#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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 928e639

Please sign in to comment.