summaryrefslogtreecommitdiffstats
path: root/source/xap/xpdf/patches/xpdf-resizefix.diff
blob: 4be7feb0a7cf4596ddbec40a4e9dc60fcb8c705f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- ./fofi/FoFiType1.cc.orig	2007-02-27 16:05:51.000000000 -0600
+++ ./fofi/FoFiType1.cc	2007-04-11 19:58:28.000000000 -0500
@@ -235,9 +235,14 @@
 	    }
 	  }
 	} 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;
 	  }
 	}
       }
--- ./splash/Splash.cc.orig	2007-02-27 16:05:52.000000000 -0600
+++ ./splash/Splash.cc	2007-04-11 19:58:35.000000000 -0500
@@ -1501,6 +1501,11 @@
     xPath->aaScale();
   }
   xPath->sort();
+  if (!&xPath->segs[0])
+  {
+    delete xPath;
+    return splashErrEmptyPath;
+  }
   scanner = new SplashXPathScanner(xPath, eo);
 
   // get the min and max x and y values