From 43763bea31d65241263b23ff6fda3fc47f51bd6e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 14 Mar 2017 14:23:48 +0000 Subject: [PATCH] [Fix] Do not reallocate completed zstd buffer --- src/lua/lua_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c index 064aa53f8..3ca34b4cc 100644 --- a/src/lua/lua_util.c +++ b/src/lua/lua_util.c @@ -1790,7 +1790,7 @@ lua_util_zstd_decompress (lua_State *L) return 2; } - if (zout.pos == zout.size) { + if (zin.pos < zin.size && zout.pos == zout.size) { /* We need to extend output buffer */ zout.size = zout.size * 1.5 + 1.0; out = g_realloc (zout.dst, zout.size); -- 2.39.5