pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pdf-devel] Bug in LZW filter?


From: Georg Gottleuber
Subject: Re: [pdf-devel] Bug in LZW filter?
Date: Fri, 02 Sep 2011 18:05:41 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.17) Gecko/20110705 Lightning/1.0b2 Lanikai/3.1.10

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02.09.2011 17:41, Georg Gottleuber wrote:

> Decoding this with pdf-filter outputs a different result as with pdfshow
> (MuPDF). (the first 400 byte are equal but pdfshow is right as it shows
> the full text)

In the decoder I think it is this sign error:

=== modified file 'src/base/pdf-stm-f-lzw.c'
- --- src/base/pdf-stm-f-lzw.c    2011-08-29 15:34:31 +0000
+++ src/base/pdf-stm-f-lzw.c    2011-09-02 15:58:50 +0000
@@ -687,7 +687,7 @@
           if (!lzwdec_put_decoded (st, out))
             return PDF_STM_FILTER_APPLY_STATUS_NO_OUTPUT; /* No more
output */

- -          if (st->dict.size == st->buffer.maxval - 1 - st->early_change)
+          if (st->dict.size == st->buffer.maxval + 1 - st->early_change)
             {
               lzw_buffer_inc_bitsize (&st->buffer);
               /* break; We must wait for the reset code, don't reset
yet. */

Did not thought that I find the error that fast. Sorry if you searched
for it meanwhile.

A patch will follow.

Regards,
Georg

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5g/tQACgkQ5sLITM1qIaIdWQCfa/lwO2gKmvViA2/AWYgzka8K
TQUAniYm5l71V4QH+tmm/bkDuxY05KyZ
=O2uk
-----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]