[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdegraphics/kpdf/xpdf/fofi
From:       Albert Astals Cid <tsdgeos () terra ! es>
Date:       2005-04-30 14:34:54
Message-ID: 20050430143454.3BE35665 () office ! kde ! org
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic