Skip to content
This repository was archived by the owner on Jan 5, 2021. It is now read-only.

Commit 4dbdb20

Browse files
+ fixed VS2010 detection on Mono
+ fixed IndexOutOfRange exception in Wrap(new byte[1])
1 parent e0327c2 commit 4dbdb20

File tree

25 files changed

+97
-91
lines changed

25 files changed

+97
-91
lines changed

LICENSE

+16-24
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
1-
Copyright (c) 2015, Milosz Krajewski
1+
Copyright (c) 2013-2015, Milosz Krajewski
22
All rights reserved.
33

4-
Redistribution and use in source and binary forms, with or without
5-
modification, are permitted provided that the following conditions are met:
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided
5+
that the following conditions are met:
66

7-
* Redistributions of source code must retain the above copyright notice, this
8-
list of conditions and the following disclaimer.
9-
10-
* Redistributions in binary form must reproduce the above copyright notice,
11-
this list of conditions and the following disclaimer in the documentation
12-
and/or other materials provided with the distribution.
13-
14-
* Neither the name of lz4net nor the names of its
15-
contributors may be used to endorse or promote products derived from
16-
this software without specific prior written permission.
17-
18-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7+
* Redistributions of source code must retain the above copyright notice, this list of conditions
8+
and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11+
and the following disclaimer in the documentation and/or other materials provided with the distribution.
2812

13+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
14+
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
15+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
16+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
17+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
18+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
20+
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ Multiple (MixedMode, Unsafe, Safe, ...) .NET implementations of LZ4 - ultra fast
44

55
---
66

7-
Sources has beem moved to GitHub, while project documentation is still hosted at [codeplex](https://lz4net.codeplex.com/)
7+
Sources has been moved to GitHub, while project documentation is still hosted at [codeplex](https://lz4net.codeplex.com/)
88

9-
Original LZ4 implementation has been written in C by Yann Collet and original sources can be found [here](https://github.com/Cyan4973/lz4)
9+
LZ4 has been written by Yann Collet and original C sources can be found [here](https://github.com/Cyan4973/lz4)

original/lz4.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ int LZ4_uncompress(const char* source,
822822
BYTE* cpy;
823823

824824
#ifdef LZ4_MK_OPT
825-
const BYTE* oend_LASTLITERALS = oend - LASTLITERALS;
825+
const BYTE* oend_LASTLITERALS = oend - LASTLITERALS;
826826
const BYTE* oend_COPYLENGTH = oend - COPYLENGTH;
827827
const BYTE* oend_COPYLENGTH_STEPSIZE_4 = oend - COPYLENGTH - (STEPSIZE - 4);
828828
#endif

release/default.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Properties {
2-
$release = "1.0.5.93"
2+
$release = "1.0.6.93"
33
$src = "..\source"
44
$sln = "$src\LZ4.sln"
55
$snk = "$src\LZ4.snk"

release/lz4net.1.0.5.93.nuspec release/lz4net.1.0.6.93.nuspec

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata>
44
<id>lz4net</id>
5-
<version>1.0.5.93</version>
5+
<version>1.0.6.93</version>
66
<title>lz4net</title>
77
<authors>Milosz Krajewski</authors>
88
<owners>Milosz Krajewski</owners>
@@ -14,8 +14,8 @@
1414
It is actually 6 DLLs packed inside facade DLL which will select the fastest one depending on platform.
1515
Multiple implementations give you ability to use it in any environment (trust level).</description>
1616
<summary>Six implementations (safe, unsafe, C++/CLI x86/x64, MixedMode x86/x64) of LZ4 and LZ4HC - ultra fast compression algorithm.</summary>
17-
<releaseNotes>+ added wrapping functions
18-
+ added VS 2010 runtime detection</releaseNotes>
17+
<releaseNotes>+ fixed VS2010 detection on Mono
18+
+ fixed IndexOutOfRange exception when using Wrapwith small buffers</releaseNotes>
1919
<copyright>Milosz Krajewski</copyright>
2020
<tags>lz4 lz4hc fast compression decompression zlib lzf lzo snappy quicklz</tags>
2121
</metadata>

source/LZ4.MixedModeAutoLoad/Properties/AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
3434
[assembly: AssemblyVersion("1.0.0.0")]
35-
[assembly: AssemblyFileVersion("1.0.5.93")]
35+
[assembly: AssemblyFileVersion("1.0.6.93")]

source/LZ4.Tests.Continuous/Properties/AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
3535
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.5.93")]
36+
[assembly: AssemblyFileVersion("1.0.6.93")]

source/LZ4.Tests.Helpers/Properties/AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
3535
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.5.93")]
36+
[assembly: AssemblyFileVersion("1.0.6.93")]

source/LZ4.Tests/Properties/AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
3535
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.5.93")]
36+
[assembly: AssemblyFileVersion("1.0.6.93")]

source/LZ4.Tests/WrapTests.cs

+12
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,17 @@ public void WrapRandom()
3434
Convert.ToBase64String(buffer),
3535
Convert.ToBase64String(decompressed));
3636
}
37+
38+
[Test]
39+
public void Wrap1B()
40+
{
41+
LZ4Codec.Wrap(new byte[1]);
42+
}
43+
44+
[Test]
45+
public void Wrap1B_HC()
46+
{
47+
LZ4Codec.WrapHC(new byte[1]);
48+
}
3749
}
3850
}

source/LZ4.sln

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.30110.0
4+
VisualStudioVersion = 12.0.31101.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LZ4n", "LZ4n\LZ4n.csproj", "{CAC778E5-28BC-475E-8CAA-46A133184DDB}"
77
EndProject
@@ -181,8 +181,8 @@ Global
181181
HideSolutionNode = FALSE
182182
EndGlobalSection
183183
GlobalSection(NestedProjects) = preSolution
184-
{4F147A19-3F56-4D50-BB57-C472F45C3CC1} = {ABD35578-609F-43CC-8749-5E1EA196560B}
185184
{5CC5CF21-5EF3-4B70-A191-22946C8C4175} = {ABD35578-609F-43CC-8749-5E1EA196560B}
185+
{4F147A19-3F56-4D50-BB57-C472F45C3CC1} = {ABD35578-609F-43CC-8749-5E1EA196560B}
186186
{D42728A8-B824-4C7A-84D7-AFFD3CB17F90} = {ABD35578-609F-43CC-8749-5E1EA196560B}
187187
{FCE38D40-0406-47F4-930D-03534E7F9119} = {ABD35578-609F-43CC-8749-5E1EA196560B}
188188
EndGlobalSection

source/LZ4/LZ4.csproj

-5
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,8 @@
4141
</PropertyGroup>
4242
<ItemGroup>
4343
<Reference Include="System" />
44-
<Reference Include="System.ComponentModel.Composition" />
4544
<Reference Include="System.Core" />
46-
<Reference Include="System.Xml.Linq" />
47-
<Reference Include="System.Data.DataSetExtensions" />
4845
<Reference Include="Microsoft.CSharp" />
49-
<Reference Include="System.Data" />
50-
<Reference Include="System.Xml" />
5146
</ItemGroup>
5247
<ItemGroup>
5348
<Compile Include="LZ4Stream.cs" />

source/LZ4/LZ4Codec.cs

+28-18
Original file line numberDiff line numberDiff line change
@@ -160,28 +160,15 @@ static LZ4Codec()
160160
}
161161
}
162162

163-
/// <summary>Determines whether VS2010 runtime is installed.</summary>
163+
/// <summary>Determines whether VS2010 runtime is installed.
164+
/// Note, on Mono the Registry class is not available at all,
165+
/// so access to it have to be isolated (thus: <see cref="Has2010RuntimeImpl"/>).</summary>
164166
/// <returns><c>true</c> it VS2010 runtime is installed, <c>false</c> otherwise.</returns>
165167
private static bool Has2010Runtime()
166168
{
167169
try
168170
{
169-
var keyName =
170-
IntPtr.Size == 4 ? @"SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86" :
171-
IntPtr.Size == 8 ? @"SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\VC\VCRedist\x64" :
172-
null;
173-
if (keyName == null)
174-
return false;
175-
176-
var key = Registry.LocalMachine.OpenSubKey(keyName, false);
177-
if (key == null)
178-
return false;
179-
180-
var value = key.GetValue(@"Installed");
181-
if (value == null)
182-
return false;
183-
184-
return Convert.ToUInt32(value) != 0;
171+
return Has2010RuntimeImpl();
185172
}
186173
catch
187174
{
@@ -293,6 +280,29 @@ private static ILZ4Service AutoTest(ILZ4Service service)
293280

294281
// ReSharper disable InconsistentNaming
295282

283+
/// <summary>Determines whether VS2010 runtime is installed. The actual implementation.</summary>
284+
/// <returns><c>true</c> it VS2010 runtime is installed, <c>false</c> otherwise. Uses registry to check.</returns>
285+
[MethodImpl(MethodImplOptions.NoInlining)]
286+
private static bool Has2010RuntimeImpl()
287+
{
288+
var keyName =
289+
IntPtr.Size == 4 ? @"SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86" :
290+
IntPtr.Size == 8 ? @"SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\VC\VCRedist\x64" :
291+
null;
292+
if (keyName == null)
293+
return false;
294+
295+
var key = Registry.LocalMachine.OpenSubKey(keyName, false);
296+
if (key == null)
297+
return false;
298+
299+
var value = key.GetValue(@"Installed");
300+
if (value == null)
301+
return false;
302+
303+
return Convert.ToUInt32(value) != 0;
304+
}
305+
296306
/// <summary>Initializes codecs from LZ4mm.</summary>
297307
[MethodImpl(MethodImplOptions.NoInlining)]
298308
private static void InitializeLZ4mm()
@@ -562,7 +572,7 @@ private static byte[] Wrap(byte[] inputBuffer, int inputOffset, int inputLength,
562572

563573
byte[] result;
564574

565-
if (outputLength >= inputLength || outputLength == 0)
575+
if (outputLength >= inputLength || outputLength <= 0)
566576
{
567577
result = new byte[inputLength + WRAP_LENGTH];
568578
Poke4(result, WRAP_OFFSET_0, (uint)inputLength);

source/LZ4/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
//
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
33-
// [assembly: AssemblyVersion("1.0.5.93")]
34-
[assembly: AssemblyVersion("1.0.5.93")]
35-
[assembly: AssemblyFileVersion("1.0.5.93")]
33+
// [assembly: AssemblyVersion("1.0.6.93")]
34+
[assembly: AssemblyVersion("1.0.6.93")]
35+
[assembly: AssemblyFileVersion("1.0.6.93")]

source/LZ4cc/AssemblyInfo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ using namespace System::Security::Permissions;
3434
// You can specify all the value or you can default the Revision and Build Numbers
3535
// by using the '*' as shown below:
3636

37-
[assembly:AssemblyVersionAttribute("1.0.5.93")];
37+
[assembly:AssemblyVersionAttribute("1.0.6.93")];
3838
[assembly:ComVisible(false)];
3939
[assembly:CLSCompliantAttribute(true)];
4040
[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];

source/LZ4cc/app.rc

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ END
4242
//
4343

4444
1 VERSIONINFO
45-
FILEVERSION 1,0,5,93
46-
PRODUCTVERSION 1,0,5,93
45+
FILEVERSION 1,0,6,93
46+
PRODUCTVERSION 1,0,6,93
4747
FILEFLAGSMASK 0x0L
4848
#ifdef _DEBUG
4949
FILEFLAGS 0x21L
@@ -60,11 +60,11 @@ BEGIN
6060
BEGIN
6161
VALUE "CompanyName", "Milosz Krajewski"
6262
VALUE "FileDescription", "LZ4cc"
63-
VALUE "FileVersion", "1.0.5.93"
63+
VALUE "FileVersion", "1.0.6.93"
6464
VALUE "LegalCopyright", "Copyright (c) 2014, Milosz Krajewski"
6565
VALUE "OriginalFilename", "LZ4cc.dll"
6666
VALUE "ProductName", "LZ4cc"
67-
VALUE "ProductVersion", "1.0.5.93"
67+
VALUE "ProductVersion", "1.0.6.93"
6868
END
6969
END
7070
BLOCK "VarFileInfo"

source/LZ4mm/AssemblyInfo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ using namespace System::Security::Permissions;
3434
// You can specify all the value or you can default the Revision and Build Numbers
3535
// by using the '*' as shown below:
3636

37-
[assembly:AssemblyVersionAttribute("1.0.5.93")];
37+
[assembly:AssemblyVersionAttribute("1.0.6.93")];
3838
[assembly:ComVisible(false)];
3939
[assembly:CLSCompliantAttribute(true)];
4040
[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];

source/LZ4mm/app.rc

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ END
4242
//
4343

4444
1 VERSIONINFO
45-
FILEVERSION 1,0,5,93
46-
PRODUCTVERSION 1,0,5,93
45+
FILEVERSION 1,0,6,93
46+
PRODUCTVERSION 1,0,6,93
4747
FILEFLAGSMASK 0x0L
4848
#ifdef _DEBUG
4949
FILEFLAGS 0x21L
@@ -60,11 +60,11 @@ BEGIN
6060
BEGIN
6161
VALUE "CompanyName", "Milosz Krajewski"
6262
VALUE "FileDescription", "LZ4mm"
63-
VALUE "FileVersion", "1.0.5.93"
63+
VALUE "FileVersion", "1.0.6.93"
6464
VALUE "LegalCopyright", "Copyright (c) 2014, Milosz Krajewski"
6565
VALUE "OriginalFilename", "LZ4mm.dll"
6666
VALUE "ProductName", "LZ4mm"
67-
VALUE "ProductVersion", "1.0.5.93"
67+
VALUE "ProductVersion", "1.0.6.93"
6868
END
6969
END
7070
BLOCK "VarFileInfo"

source/LZ4n/LZ4Codec.Unsafe.cs

+2
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ public static unsafe int Encode32HC(
508508
fixed (byte* outputPtr = &output[outputOffset])
509509
{
510510
var length = LZ4_compressHC_32(inputPtr, outputPtr, inputLength, outputLength);
511+
// NOTE: there is a potential problem here as original implementation returns 0 not -1
511512
return length <= 0 ? -1 : length;
512513
}
513514
}
@@ -573,6 +574,7 @@ public static unsafe int Encode64HC(
573574
fixed (byte* outputPtr = &output[outputOffset])
574575
{
575576
var length = LZ4_compressHC_64(inputPtr, outputPtr, inputLength, outputLength);
577+
// NOTE: there is a potential problem here as original implementation returns 0 not -1
576578
return length <= 0 ? -1 : length;
577579
}
578580
}

source/LZ4n/LZ4Codec.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public static partial class LZ4Codec
6969
/// <summary>Buffer length when Buffer.BlockCopy becomes faster than straight loop.
7070
/// Please note that safe implementation REQUIRES it to be greater (not even equal) than 8.</summary>
7171
private const int BLOCK_COPY_LIMIT = 16;
72+
7273
#endif
7374

7475
#endregion
@@ -109,15 +110,15 @@ public static partial class LZ4Codec
109110
private const int HASHHC_ADJUST = (MINMATCH * 8) - HASHHC_LOG;
110111
//private const int HASHHC_MASK = HASHHC_TABLESIZE - 1;
111112

112-
private static readonly int[] DECODER_TABLE_32 = new[] { 0, 3, 2, 3, 0, 0, 0, 0 };
113-
private static readonly int[] DECODER_TABLE_64 = new[] { 0, 0, 0, -1, 0, 1, 2, 3 };
113+
private static readonly int[] DECODER_TABLE_32 = { 0, 3, 2, 3, 0, 0, 0, 0 };
114+
private static readonly int[] DECODER_TABLE_64 = { 0, 0, 0, -1, 0, 1, 2, 3 };
114115

115-
private static readonly int[] DEBRUIJN_TABLE_32 = new[] {
116+
private static readonly int[] DEBRUIJN_TABLE_32 = {
116117
0, 0, 3, 0, 3, 1, 3, 0, 3, 2, 2, 1, 3, 2, 0, 1,
117118
3, 3, 1, 2, 2, 2, 2, 0, 3, 1, 2, 0, 1, 0, 1, 1
118119
};
119120

120-
private static readonly int[] DEBRUIJN_TABLE_64 = new[] {
121+
private static readonly int[] DEBRUIJN_TABLE_64 = {
121122
0, 0, 0, 0, 0, 1, 1, 2, 0, 3, 1, 3, 1, 4, 2, 7,
122123
0, 2, 3, 6, 1, 5, 3, 5, 1, 3, 4, 4, 2, 5, 6, 7,
123124
7, 0, 1, 2, 3, 3, 4, 6, 2, 6, 5, 5, 3, 4, 5, 6,

source/LZ4n/LZ4n.csproj

-4
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@
4242
<ItemGroup>
4343
<Reference Include="System" />
4444
<Reference Include="System.Core" />
45-
<Reference Include="System.Xml.Linq" />
46-
<Reference Include="System.Data.DataSetExtensions" />
4745
<Reference Include="Microsoft.CSharp" />
48-
<Reference Include="System.Data" />
49-
<Reference Include="System.Xml" />
5046
</ItemGroup>
5147
<ItemGroup>
5248
<Compile Include="LZ4Codec.Unsafe32HC.Dirty.cs" />

source/LZ4n/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
//
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
33-
// [assembly: AssemblyVersion("1.0.5.93")]
34-
[assembly: AssemblyVersion("1.0.5.93")]
35-
[assembly: AssemblyFileVersion("1.0.5.93")]
33+
// [assembly: AssemblyVersion("1.0.6.93")]
34+
[assembly: AssemblyVersion("1.0.6.93")]
35+
[assembly: AssemblyFileVersion("1.0.6.93")]

source/LZ4s/LZ4Codec.Safe.cs

+2
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,7 @@ public static int Encode32HC(
653653
output, outputOffset, ref outputLength);
654654

655655
var length = LZ4_compressHC_32(input, inputOffset, inputLength, output, outputOffset, outputLength);
656+
// NOTE: there is a potential problem here as original implementation returns 0 not -1
656657
return length <= 0 ? -1 : length;
657658
}
658659

@@ -718,6 +719,7 @@ public static int Encode64HC(
718719
output, outputOffset, ref outputLength);
719720

720721
var length = LZ4_compressHC_64(input, inputOffset, inputLength, output, outputOffset, outputLength);
722+
// NOTE: there is a potential problem here as original implementation returns 0 not -1
721723
return length <= 0 ? -1 : length;
722724
}
723725

0 commit comments

Comments
 (0)