diff options
author | reduz <reduzio@gmail.com> | 2014-03-12 08:37:14 -0700 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2014-03-12 08:37:14 -0700 |
commit | c7a03a064845201be871395f5475c436dc520ac6 (patch) | |
tree | 08c801958372a2a1e002b2409a260b897d636755 /core | |
parent | cbcba776c1d2fe00bb4d0a9be1272865f3d4e2f9 (diff) | |
parent | 1be5d6f665b51cb0d1532971783345c5e81d4638 (diff) |
Merge pull request #188 from marynate/PR-fix-compression-return
Fix Compression bug: wrong premature return.
Diffstat (limited to 'core')
-rw-r--r-- | core/io/compression.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/io/compression.cpp b/core/io/compression.cpp index 67ba5de0fa..ea2f5d2d9c 100644 --- a/core/io/compression.cpp +++ b/core/io/compression.cpp @@ -55,7 +55,7 @@ int Compression::compress(uint8_t *p_dst, const uint8_t *p_src, int p_src_size,M strm.zfree = zipio_free; strm.opaque = Z_NULL; int err = deflateInit(&strm,Z_DEFAULT_COMPRESSION); - if (err==Z_OK) + if (err!=Z_OK) return -1; strm.avail_in=p_src_size; @@ -93,7 +93,7 @@ int Compression::get_max_compressed_buffer_size(int p_src_size,Mode p_mode){ strm.zfree = zipio_free; strm.opaque = Z_NULL; int err = deflateInit(&strm,Z_DEFAULT_COMPRESSION); - if (err==Z_OK) + if (err!=Z_OK) return -1; int aout = deflateBound(&strm,p_src_size); deflateEnd(&strm); |