Skip to content

Commit

Permalink
Allow negative zstd compression level
Browse files Browse the repository at this point in the history
  • Loading branch information
ahupna committed Aug 21, 2023
1 parent 680d6f1 commit 63d0843
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions mz_strm_zstd.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ typedef struct mz_stream_zstd_s {
int64_t max_total_in;
int64_t max_total_out;
int8_t initialized;
uint32_t preset;
int32_t preset;
} mz_stream_zstd;

/***************************************************************************/
Expand Down Expand Up @@ -312,10 +312,7 @@ int32_t mz_stream_zstd_set_prop_int64(void *stream, int32_t prop, int64_t value)
mz_stream_zstd *zstd = (mz_stream_zstd *)stream;
switch (prop) {
case MZ_STREAM_PROP_COMPRESS_LEVEL:
if (value < 0)
zstd->preset = 6;
else
zstd->preset = (int16_t)value;
zstd->preset = (int32_t)value;
return MZ_OK;
case MZ_STREAM_PROP_TOTAL_IN_MAX:
zstd->max_total_in = value;
Expand Down

0 comments on commit 63d0843

Please sign in to comment.