summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2005-07-26 20:34:13 +0000
committerKristian Høgsberg <krh@redhat.com>2005-07-26 20:34:13 +0000
commit2bc26dffd9f296799617d319055648c20f748c8a (patch)
tree948c176c04172dfdfc1e51d0409663878c66198e
parent07911274e4e850a628b1e587cafc2a73c05f93fe (diff)
2005-07-26 Kristian Høgsberg <krh@redhat.com>
* fofi/FoFiType1.cc: Make check for end of encoding array a bit more liberal so we don't crash on complex encoding arrays (#3344).
-rw-r--r--ChangeLog5
-rw-r--r--fofi/FoFiType1.cc21
2 files changed, 12 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 04a46aef..02b16101 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-26 Kristian Høgsberg <krh@redhat.com>
+
+ * fofi/FoFiType1.cc: Make check for end of encoding array a bit
+ more liberal so we don't crash on complex encoding arrays.
+
2005-07-25 Albert Astals Cid <aacid@kde.org>
* poppler/DCTStream.cc: Work on bad jpeg data that have garbage before
diff --git a/fofi/FoFiType1.cc b/fofi/FoFiType1.cc
index 16a91685..6c5ed3d9 100644
--- a/fofi/FoFiType1.cc
+++ b/fofi/FoFiType1.cc
@@ -186,20 +186,13 @@ void FoFiType1::parse() {
}
}
}
- } else {
- 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(NULL, " \t\n\r");
- if (p && !strcmp(p, "def"))
- break;
- }
- }
+ }
+
+ // Any line that begins with "def" or contains " def"
+ // terminates the encoding array.
+ if (!strcmp (p, "def") || strstr (buf, " def"))
+ break;
+
line = line1;
}
//~ check for getinterval/putinterval junk