From e1f7f8d8c41e0de954428d6b959af4c35eb224e2 Mon Sep 17 00:00:00 2001 From: Frederic Langlet Date: Sat, 15 Feb 2020 19:14:31 -0800 Subject: [PATCH] Fix exit condition --- function/LZCodec.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/function/LZCodec.go b/function/LZCodec.go index a55babae..58c4978b 100644 --- a/function/LZCodec.go +++ b/function/LZCodec.go @@ -608,7 +608,7 @@ func (this *LZPCodec) Forward(src, dst []byte) (uint, uint, error) { var err error - if (srcIdx != count) || (dstIdx < (count - count>>6)) { + if (srcIdx != count) || (dstIdx >= count-(count>>6)) { err = errors.New("LZP forward transform failed: output buffer too small") }