Skip to content

Commit

Permalink
#12 Tiff specific fixes for lzw
Browse files Browse the repository at this point in the history
  • Loading branch information
IldarKhayrutdinov committed Dec 3, 2020
1 parent 56ac3f8 commit 624a36c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/ImageSharp/Formats/Tiff/Utils/TiffLzwDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,12 @@ public void DecodePixels(int length, int dataSize, Span<byte> pixels)

pixelStack[top++] = suffix[code];

// Fix for Gifs that have "deferred clear code" as per here :
// https://bugzilla.mozilla.org/show_bug.cgi?id=55918
if (availableCode < MaxStackSize)
{
prefix[availableCode] = oldCode;
suffix[availableCode] = first;
availableCode++;
if (availableCode == codeMask + 1 && availableCode < MaxStackSize)
if (availableCode > codeMask - 1 && availableCode < MaxStackSize)
{
codeSize++;
codeMask = (1 << codeSize) - 1;
Expand Down

0 comments on commit 624a36c

Please sign in to comment.