PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Bug in LzwDecode.Decode
https://forum.pdfsharp.net/viewtopic.php?f=3&t=1294
Page 1 of 1

Author:  san [ Thu Aug 12, 2010 8:52 am ]
Post subject:  Bug in LzwDecode.Decode

The algorithm in LzwDecode.Decode method has a bug.

--- PDFsharp/code/PdfSharp/PdfSharp.Pdf.Filters/LzwDecode.cs (revision 64534)
+++ PDFsharp/code/PdfSharp/PdfSharp.Pdf.Filters/LzwDecode.cs (working copy)
@@ -93,6 +93,7 @@
{
str = stringTable[oldCode];
outputStream.Write(str, 0, str.Length);
+ outputStream.WriteByte(str[0]);
AddEntry(str, str[0]);
oldCode = code;
}

Attachments:
LzwDecode.zip [357 Bytes]
Downloaded 535 times

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/