summaryrefslogtreecommitdiff
path: root/print/xpdf
diff options
context:
space:
mode:
authordrochner <drochner@pkgsrc.org>2007-01-17 17:38:05 +0000
committerdrochner <drochner@pkgsrc.org>2007-01-17 17:38:05 +0000
commitfa160e8bb7b3c871afae289fa38b339ab563ba99 (patch)
treeaef78bd4d2bdffb71f310bb6750660bacb58f277 /print/xpdf
parent34da73646fd031c2e31a816f5d378f228d532dd9 (diff)
downloadpkgsrc-fa160e8bb7b3c871afae289fa38b339ab563ba99.tar.gz
apply the patch from poppler to fix MOAB-06-01-2007 (DOS)
bump PKGREVISION
Diffstat (limited to 'print/xpdf')
-rw-r--r--print/xpdf/Makefile4
-rw-r--r--print/xpdf/distinfo4
-rw-r--r--print/xpdf/patches/patch-av52
-rw-r--r--print/xpdf/patches/patch-aw13
4 files changed, 70 insertions, 3 deletions
diff --git a/print/xpdf/Makefile b/print/xpdf/Makefile
index be01c54a301..5a3cd894841 100644
--- a/print/xpdf/Makefile
+++ b/print/xpdf/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.59 2006/11/06 10:47:18 joerg Exp $
+# $NetBSD: Makefile,v 1.60 2007/01/17 17:38:05 drochner Exp $
DISTNAME= xpdf-3.01
PKGNAME= ${DISTNAME}pl2
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= print
MASTER_SITES= ftp://ftp.foolabs.com/pub/xpdf/ \
${MASTER_SITE_SUNSITE:=apps/graphics/viewers/X/xpdf/} \
diff --git a/print/xpdf/distinfo b/print/xpdf/distinfo
index f34694a63d5..8ba25565b2c 100644
--- a/print/xpdf/distinfo
+++ b/print/xpdf/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.27 2006/05/30 20:03:28 tron Exp $
+$NetBSD: distinfo,v 1.28 2007/01/17 17:38:05 drochner Exp $
SHA1 (xpdf-3.01.tar.gz) = 472cbf0f3df4e20a3ab7ada2e704b4e10d1d385b
RMD160 (xpdf-3.01.tar.gz) = d734065ce12db8d0c37d9d0ac0ca7c287be59442
@@ -24,3 +24,5 @@ SHA1 (patch-ao) = 3bd1be205e87cdbe3f2329e932c540185a7c3d09
SHA1 (patch-ap) = e2782308f544d4589590e833897823f4dc1b6315
SHA1 (patch-ar) = f3d320991e189a21244acd31ca5cc6cfdb18bd96
SHA1 (patch-au) = af765089ee88369da0afef534f46ec50c5cc6d4f
+SHA1 (patch-av) = c4110136862eae9dba84c4abf387c2e580d3e8e0
+SHA1 (patch-aw) = 0aae65012380a0c75596ae260713fdc41b35f9ce
diff --git a/print/xpdf/patches/patch-av b/print/xpdf/patches/patch-av
new file mode 100644
index 00000000000..fab9953b315
--- /dev/null
+++ b/print/xpdf/patches/patch-av
@@ -0,0 +1,52 @@
+$NetBSD: patch-av,v 1.1 2007/01/17 17:38:05 drochner Exp $
+
+--- xpdf/Catalog.cc.orig 2005-08-17 07:34:31.000000000 +0200
++++ xpdf/Catalog.cc
+@@ -23,6 +23,12 @@
+ #include "Link.h"
+ #include "Catalog.h"
+
++// This define is used to limit the depth of recursive readPageTree calls
++// This is needed because the page tree nodes can reference their parents
++// leaving us in an infinite loop
++// Most sane pdf documents don't have a call depth higher than 10
++#define MAX_CALL_DEPTH 1000
++
+ //------------------------------------------------------------------------
+ // Catalog
+ //------------------------------------------------------------------------
+@@ -71,7 +77,7 @@ Catalog::Catalog(XRef *xrefA) {
+ pageRefs[i].num = -1;
+ pageRefs[i].gen = -1;
+ }
+- numPages = readPageTree(pagesDict.getDict(), NULL, 0);
++ numPages = readPageTree(pagesDict.getDict(), NULL, 0, 0);
+ if (numPages != numPages0) {
+ error(-1, "Page count in top-level pages object is incorrect");
+ }
+@@ -169,7 +175,7 @@ GString *Catalog::readMetadata() {
+ return s;
+ }
+
+-int Catalog::readPageTree(Dict *pagesDict, PageAttrs *attrs, int start) {
++int Catalog::readPageTree(Dict *pagesDict, PageAttrs *attrs, int start, int callDepth) {
+ Object kids;
+ Object kid;
+ Object kidRef;
+@@ -214,9 +220,13 @@ int Catalog::readPageTree(Dict *pagesDic
+ // This should really be isDict("Pages"), but I've seen at least one
+ // PDF file where the /Type entry is missing.
+ } else if (kid.isDict()) {
+- if ((start = readPageTree(kid.getDict(), attrs1, start))
+- < 0)
+- goto err2;
++ if (callDepth > MAX_CALL_DEPTH) {
++ error(-1, "Limit of %d recursive calls reached while reading the page tree. If your document is correct and not a test to try to force a crash, please report a bug.", MAX_CALL_DEPTH);
++ } else {
++ if ((start = readPageTree(kid.getDict(), attrs1, start, callDepth + 1))
++ < 0)
++ goto err2;
++ }
+ } else {
+ error(-1, "Kid object (page %d) is wrong type (%s)",
+ start+1, kid.getTypeName());
diff --git a/print/xpdf/patches/patch-aw b/print/xpdf/patches/patch-aw
new file mode 100644
index 00000000000..4e7a2ea0deb
--- /dev/null
+++ b/print/xpdf/patches/patch-aw
@@ -0,0 +1,13 @@
+$NetBSD: patch-aw,v 1.1 2007/01/17 17:38:05 drochner Exp $
+
+--- xpdf/Catalog.h.orig 2005-08-17 07:34:31.000000000 +0200
++++ xpdf/Catalog.h
+@@ -85,7 +85,7 @@ private:
+ Object acroForm; // AcroForm dictionary
+ GBool ok; // true if catalog is valid
+
+- int readPageTree(Dict *pages, PageAttrs *attrs, int start);
++ int readPageTree(Dict *pages, PageAttrs *attrs, int start, int callDepth);
+ Object *findDestInTree(Object *tree, GString *name, Object *obj);
+ };
+