summaryrefslogtreecommitdiff
path: root/core/io/compression.cpp
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2021-07-13 16:07:42 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2021-07-13 16:34:45 +0800
commitccf292df3856f178efc5b9ef84fbea4bf15187fa (patch)
tree09be34bc7e6ed60db22e629c66549d4f12896fcf /core/io/compression.cpp
parente2b79e9591436df76efbeda8abf93a562f66a02f (diff)
Fix decompression with FastLZ when buffer size is less than 16 bytes
Diffstat (limited to 'core/io/compression.cpp')
-rw-r--r--core/io/compression.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/io/compression.cpp b/core/io/compression.cpp
index ca56509253..790b6febc0 100644
--- a/core/io/compression.cpp
+++ b/core/io/compression.cpp
@@ -134,8 +134,9 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_max_size, const uint8_t *p
if (p_dst_max_size < 16) {
uint8_t dst[16];
- ret_size = fastlz_decompress(p_src, p_src_size, dst, 16);
+ fastlz_decompress(p_src, p_src_size, dst, 16);
memcpy(p_dst, dst, p_dst_max_size);
+ ret_size = p_dst_max_size;
} else {
ret_size = fastlz_decompress(p_src, p_src_size, p_dst, p_dst_max_size);
}