diff options
Diffstat (limited to 'core/io/compression.cpp')
-rw-r--r-- | core/io/compression.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/io/compression.cpp b/core/io/compression.cpp index 1b6786d888..99ca8107e4 100644 --- a/core/io/compression.cpp +++ b/core/io/compression.cpp @@ -62,8 +62,9 @@ int Compression::compress(uint8_t *p_dst, const uint8_t *p_src, int p_src_size, strm.opaque = Z_NULL; int level = p_mode == MODE_DEFLATE ? zlib_level : gzip_level; int err = deflateInit2(&strm, level, Z_DEFLATED, window_bits, 8, Z_DEFAULT_STRATEGY); - if (err != Z_OK) + if (err != Z_OK) { return -1; + } strm.avail_in = p_src_size; int aout = deflateBound(&strm, p_src_size); @@ -97,8 +98,9 @@ int Compression::get_max_compressed_buffer_size(int p_src_size, Mode p_mode) { switch (p_mode) { case MODE_FASTLZ: { int ss = p_src_size + p_src_size * 6 / 100; - if (ss < 66) + if (ss < 66) { ss = 66; + } return ss; } break; @@ -111,8 +113,9 @@ int Compression::get_max_compressed_buffer_size(int p_src_size, Mode p_mode) { strm.zfree = zipio_free; strm.opaque = Z_NULL; int err = deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, window_bits, 8, Z_DEFAULT_STRATEGY); - if (err != Z_OK) + if (err != Z_OK) { return -1; + } int aout = deflateBound(&strm, p_src_size); deflateEnd(&strm); return aout; |