Preliminary patch for 687090, /ioerror in --token--
Alex Cherepanov <[email protected]>
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Organization | Coscript Software |
| Message-ID | <[email protected]> |
This is a preliminary patch posted as a basis for discussion. It fixes the bug 687090 indeed, but is not robust enough to for production use. Although all the streams in PDF must be self-terminated, some implementations produce unterminated files. Currently Ghostscript cannot recover from this condition. I'm asking everybody's opinion about running all streams through /SubFileDecode filter as the patch does. Production version of the patch should also validate the /Length atribute and correct it if needed. _______________________________________________ gs-code-review mailing list [email protected] http://www.ghostscript.com/mailman/listinfo/gs-code-review
pdf_base.ps.diff
(text/plain, 665 B)
Index: gs/lib/pdf_base.ps
===================================================================
RCS file: /cvs/ghostscript/gs/lib/pdf_base.ps,v
retrieving revision 1.38
diff -b -u -r1.38 pdf_base.ps
--- gs/lib/pdf_base.ps 29 May 2003 19:02:00 -0000 1.38
+++ gs/lib/pdf_base.ps 14 Nov 2003 15:13:07 -0000
@@ -618,6 +618,12 @@
% Stack: readdata? dict parms filternames
2 index /File get exch
% Stack: readdata? dict parms file/string filternames
+
+ exch
+ 3 index /Length oget () /SubFileDecode filter
+ exch
+
+
pdf_decrypt_stream % add decryption if needed
dup length 0 eq {
% All the PDF filters have EOD markers, but in this case