[Poppler-bugs] [Bug 17252] crash in Document Viewer
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Tue Sep 1 00:17:01 PDT 2009
http://bugs.freedesktop.org/show_bug.cgi?id=17252
--- Comment #1 from David Benjamin <davidben at mit.edu> 2009-09-01 00:17:00 PST ---
Created an attachment (id=29058)
--> (http://bugs.freedesktop.org/attachment.cgi?id=29058)
Maintain Type0 fonts when using embedded font type
This patch should fix the bug.
As I understand, the PDF is malformed. The font with object number 58 has type
/Type0 has a descendant font (57 0 R) whose font descriptor (56 0 R) points to
(via /FontFile3) embedded font program 71 0 R. Object 71 has type /Type1C,
which, from table 5.23, can only appear in Type1 or MMType1 fonts. This is
where the "Mismatch between font type and embedded font file" is coming from.
Poppler uses the embedded font's type when the types do not match. However, it
blindly sets the type, ignoring the fact that Type0 fonts get a different class
(GfxCIDFont instead of Gfx8BitFont) and a different set of types
(fontCIDType*). Later, when the font is used, we downcast by reinterpreting the
pointer based on the type. When the type is wrong, a GfxCIDFont is interpreted
as a Gfx8BitFont and Bad Things happen.
Assuming I did this right, the patch should fix this. When we set the type from
a mismatch, we check if the font is CID and pick the equivalent font type from
CID set and vice versa. Also, a helpful warning is displayed.
(Disclaimer: I don't actually understand PDF fonts... skimmed the spec for
relevant-looking bits to implement this. It does successfully render the PDF
without extra warnings, which is a good sign.)
--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Poppler-bugs
mailing list