summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2023-01-21 21:51:20 +0800
committerruki <[email protected]>2023-01-21 21:51:20 +0800
commite7cc15499e3fbf09f7772ca38d79892787c1d98b (patch)
tree7d01720f94993abf863cee40deb7665262e5ec20 /core/src
parent18f00253bb8be734d7d98957ce85d8f64b520c30 (diff)
improve lz4
Diffstat (limited to 'core/src')
-rw-r--r--core/src/xmake/lz4/block_decompress.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/xmake/lz4/block_decompress.c b/core/src/xmake/lz4/block_decompress.c
index c8c75adf2..7de823a70 100644
--- a/core/src/xmake/lz4/block_decompress.c
+++ b/core/src/xmake/lz4/block_decompress.c
@@ -68,10 +68,10 @@ tb_int_t xm_lz4_block_decompress(lua_State* lua)
output_data = real <= sizeof(buffer)? buffer : (tb_byte_t*)tb_malloc(real);
tb_assert_and_check_break(output_data);
- tb_int_t r = LZ4_decompress_fast((tb_char_t const*)data, (tb_char_t*)output_data, real);
+ tb_int_t r = LZ4_decompress_safe((tb_char_t const*)data, (tb_char_t*)output_data, size, real);
tb_assert_and_check_break(r > 0);
- lua_pushlstring(lua, (tb_char_t const*)output_data, real);
+ lua_pushlstring(lua, (tb_char_t const*)output_data, r);
ok = tb_true;
} while (0);