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; } }