[Poppler-bugs] [Bug 11522] poppler doesn't tolerate garbage after the last %%EOF, acroread does

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Sep 2 16:21:13 PDT 2007


http://bugs.freedesktop.org/show_bug.cgi?id=11522





------- Comment #4 from dnas.dnas at gmail.com  2007-09-02 16:21 PST -------
Created an attachment (id=11393)
 --> (http://bugs.freedesktop.org/attachment.cgi?id=11393&action=view)
Allow PDF files that lack a %%EOF

(Trivial patch, but meh. :-D)

Poppler already has PDFDoc::checkHeader() only spew out warnings, so might as
well do the same for PDFDoc::checkFooter(). Plus, there's the old "Be
conservative in what you create, but be liberal in what you accept." Some PDFs
are going to be broken, so you might as well do your best in displaying them...
especially for an error as trivial as this.

I grepped the rest of the source, and I don't see any code that expects the
%%EOF to be there. And testing doesn't show any regressions.

Also I got rid of the unnecessary found variable. One can already recover
whether the string was found with the value of i.

(I wasn't sure if I should have gotten rid of the errCode = errDamaged, but
since checkHeader() doesn't set it, it seemed reasonable to remove... was that
correct?)


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Poppler-bugs mailing list