From dc1137ce0acbd3dcbedce04cb9fabe2ffbec818b Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 26 Jul 2005 21:02:31 +0000 Subject: [PATCH] Fix for crash in document from poppler bug 3344 svn path=/trunk/KDE/kdegraphics/kpdf/; revision=439007 --- xpdf/fofi/FoFiType1.cc | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/xpdf/fofi/FoFiType1.cc b/xpdf/fofi/FoFiType1.cc index 1ee5175f7..780368d65 100644 --- a/xpdf/fofi/FoFiType1.cc +++ b/xpdf/fofi/FoFiType1.cc @@ -186,17 +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(buf, " \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