Skip to content

Commit

Permalink
bugfix: offset
Browse files Browse the repository at this point in the history
  • Loading branch information
ikpil committed Oct 1, 2023
1 parent e81b8fa commit ca59125
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DotFastLZ.Compression/FastLZ.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public static long CompressLevel2(byte[] input, long inputOffset, long length, b
op = Literals(copy, input, anchor, output, op);

/* marker for fastlz2 */
output[0] |= (1 << 5);
output[inputOffset] |= (1 << 5);

return op;
}
Expand Down Expand Up @@ -285,7 +285,7 @@ public static long Decompress(byte[] input, long length, byte[] output, long max
public static long Decompress(byte[] input, long inputOffset, long length, byte[] output, long outputOffset, long maxout)
{
/* magic identifier for compression level */
int level = (input[0] >> 5) + 1;
int level = (input[inputOffset] >> 5) + 1;

if (level == 1) return DecompressLevel1(input, inputOffset, length, output, outputOffset, maxout);
if (level == 2) return DecompressLevel2(input, inputOffset, length, output, outputOffset, maxout);
Expand Down

0 comments on commit ca59125

Please sign in to comment.