Bug 688716 - /ioerror in token
Summary: /ioerror in token
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: master
Hardware: All All
: P3 normal
Assignee: Default assignee
URL:
Keywords:
: 688961 689042 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-23 08:20 UTC by Edward
Modified: 2008-12-19 08:31 UTC (History)
3 users (show)

See Also:
Customer:
Word Size: ---


Attachments
PDF file (44.80 KB, application/pdf)
2006-05-23 08:20 UTC, Edward
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Edward 2006-05-23 08:20:05 UTC
When trying to convert the attached PDF file with GS Head i get a /ioerror in 
token. The previous patches for this problem don't help.
Comment 1 Edward 2006-05-23 08:20:41 UTC
Created attachment 2221 [details]
PDF file
Comment 2 Tor Andersson 2006-05-23 08:57:27 UTC
i see this error from zlib on stream object 19 (the third and final part of the content stream array on page 
one):

inflate: incorrect data check

this error is thrown when processing the zlib stream trailer, if the stream is
either truncated or the adler checksum is wrong.

xpdf swallows this stream without any issues; xpdf doesn't use zlib.
Comment 3 Tor Andersson 2006-05-26 07:09:08 UTC
This error can only be reliably dealt with in the stream code.
Ideally, we should do something to set the Repaired flag in
the PDF interpreter, but I think that passing the condition back
up to the PDF interpreter will be too invasive, so we only print a
warning to stderr.

--- src/szlibd.c        (revision 6810)
+++ src/szlibd.c        (working copy)
@@ -87,6 +87,15 @@
        case Z_STREAM_END:
            return EOFC;
        default:
+            if (!strcmp("incorrect data check", zs->msg))
+            {
+                /* Ignore errors when zlib streams fail on the checksum.
+                 * Adobe, Apple and xpdf don't fail on pdf:s where this happens,
+                 * so neither should we. fixes bug 688716.
+                 */
+                errprintf("warning: ignoring zlib error: %s\n", zs->msg);
+                return EOFC;
+            }
            return ERRC;
     }
 }
Comment 4 Marcos H. Woehrmann 2006-10-30 15:35:43 UTC
*** Bug 688961 has been marked as a duplicate of this bug. ***
Comment 5 Alex Cherepanov 2007-02-06 18:33:52 UTC
*** Bug 689042 has been marked as a duplicate of this bug. ***