You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When doing a code review of the LZW implementation inside this repository, I stumbled upon a possible issue for special cases in the LZW algorithm where dictionary lookups would be done before the corresponding entry has been added, corresponding to the
In these cases (on line 66), the first character of the looked up string has to be appended to the output as well, as done when adding the dictionary entry itself. For reference, you might want to have a look at http://web.archive.org/web/20011214082531/http://www.rasip.fer.hr/research/compress/algorithms/fund/lz/lzw.html. (Unfortunately, I cannot provide any C# code here as I am no C# developer - I just stumbled upon this issue when reviewing some port of the corresponding functionality.)
The text was updated successfully, but these errors were encountered:
When doing a code review of the LZW implementation inside this repository, I stumbled upon a possible issue for special cases in the LZW algorithm where dictionary lookups would be done before the corresponding entry has been added, corresponding to the
PDFsharp/src/foundation/src/PDFsharp/src/PdfSharp/Pdf.Filters/LzwDecode.cs
Lines 64 to 69 in 5fbf6ed
In these cases (on line 66), the first character of the looked up string has to be appended to the output as well, as done when adding the dictionary entry itself. For reference, you might want to have a look at http://web.archive.org/web/20011214082531/http://www.rasip.fer.hr/research/compress/algorithms/fund/lz/lzw.html. (Unfortunately, I cannot provide any C# code here as I am no C# developer - I just stumbled upon this issue when reviewing some port of the corresponding functionality.)
The text was updated successfully, but these errors were encountered: