Bug 11522 - poppler doesn't tolerate garbage after the last %%EOF, acroread does
Summary: poppler doesn't tolerate garbage after the last %%EOF, acroread does
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-09 16:09 UTC by Nicholas Miell
Modified: 2007-09-03 10:11 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Sample PDF which acroread will display but fails in Evince/poppler (93.79 KB, application/pdf)
2007-07-09 16:11 UTC, Nicholas Miell
Details
Allow PDF files that lack a %%EOF (1.62 KB, patch)
2007-09-02 16:21 UTC, David Benjamin
Details | Splinter Review

Description Nicholas Miell 2007-07-09 16:09:48 UTC
The attached PDF (and every other PDF available from the US FCC OET site) opens and displays fine in acroread but fails in Evince with poppler-0.5.4-7.fc7.
Comment 1 Nicholas Miell 2007-07-09 16:11:04 UTC
Created attachment 10643 [details]
Sample PDF which acroread will display but fails in Evince/poppler
Comment 2 Albert Astals Cid 2007-07-10 11:23:07 UTC
well, PDF spec says %%EOF is the last thing of a PDF, if that thing you have does have more content after %%EOF it's not a PDF
Comment 3 Nicholas Miell 2007-07-10 15:30:42 UTC
If acroread displays it, it's PDF.
Comment 4 David Benjamin 2007-09-02 16:21:11 UTC
Created attachment 11393 [details] [review]
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?)
Comment 5 Albert Astals Cid 2007-09-03 10:11:27 UTC
i commented the checkFooter call yesterday.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.