Summary: | kpdf crashes on this file | ||
---|---|---|---|
Product: | [Unmaintained] kpdf | Reporter: | Gioele Barabucci <dev> |
Component: | general | Assignee: | Albert Astals Cid <aacid> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | 0.4 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | The PDF files that make KPDF crash |
Description
Gioele Barabucci
2005-04-29 19:55:03 UTC
Created attachment 10844 [details]
The PDF files that make KPDF crash
I can confirm, and there's no Crash Handler shown. bad stuff: #6 0xb6babb52 in strncpy () from /lib/libc.so.6 #7 0xb67fc513 in FoFiType1::parse (this=0x81d2158) at FoFiType1.cc:169 #8 0x00000000 in ?? () I've almost tracked it down to a "malformed" embedded type1 font that our parser is not as rubust as it should be CVS commit by aacid: Don't assume Encoding array of Type1 fonts end in "foo def". http://partners.adobe.com/public/developer/en/font/T1_SPEC.PDF says "This sequence of assignments must be followed by an instance of the token def or readonly; such a token may not occur within the sequence of assignments." so it must end with "readonly" "def" "readonly def" (That is what most fonts are using and this is why it was not crashing" BUG: 104786 M +8 -3 FoFiType1.cc 1.2 --- kdegraphics/kpdf/xpdf/fofi/FoFiType1.cc #1.1:1.2 @@ -188,7 +188,12 @@ void FoFiType1::parse() { } } else { - if (strtok(buf, " \t") && - (p = strtok(NULL, " \t\n\r")) && !strcmp(p, "def")) { - break; + p = strtok(buf, " \t\n\r"); + if (p) + { + if (!strcmp(p, "def")) break; + if (!strcmp(p, "readonly")) break; + // the spec does not says this but i'm mantaining old xpdf behaviour that accepts "foo def" as end of the encoding array + p = strtok(buf, " \t\n\r"); + if (p && !strcmp(p, "def")) break; } } |