Bug 19706 - Doesn't render correctly a JBIG2 based PDF
Summary: Doesn't render correctly a JBIG2 based PDF
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
Depends on:
Reported: 2009-01-23 14:13 UTC by Albert Astals Cid
Modified: 2009-06-20 14:52 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

Fixes DecryptStream::getPos() (1.51 KB, patch)
2009-06-20 14:13 UTC, David Benjamin
Details | Splinter Review

Description Albert Astals Cid 2009-01-23 14:13:24 UTC
Pages 0, 2 and 3 are not rendered correctly

Pdf found at http://launchpadlibrarian.net/21544672/01004PT1.pdf
Comment 1 David Benjamin 2009-06-20 14:13:20 UTC
Created attachment 26981 [details] [review]
Fixes DecryptStream::getPos()

This patch appears to fix the bug.

The problem is that JBIG2Stream uses the Stream::getPos() of wrapped streams to determine segment length, specifically whether too many or too few characters have been read. A LOT of streams don't provide sane values and this trips up JBIG2Stream. (Notably ones that subclass FilterStream. FilterStream provides a default implementation of getPos() which is often wrong. It only works if the Filter does not blow up or shrink the data, i.e. there is one and only one call to str->readChar() for every call to readChar().)

The culprit in this case was DecryptStream.
Comment 2 Albert Astals Cid 2009-06-20 14:52:11 UTC
Commited, keep up the good work :-)

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.