summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Stelling <blubb@gentoo.org>2006-01-28 14:43:26 +0000
committerSimon Stelling <blubb@gentoo.org>2006-01-28 14:43:26 +0000
commitf14db8e90e147f4e79c4709f64e232cb7acf60fb (patch)
treee8fa62d5ad7ea6e5853e5d2e1d2cda9e12ca1bc3 /app-text/xpdf
parentRemoved old version. Closed bug #120644. (diff)
downloadhistorical-f14db8e90e147f4e79c4709f64e232cb7acf60fb.tar.gz
historical-f14db8e90e147f4e79c4709f64e232cb7acf60fb.tar.bz2
historical-f14db8e90e147f4e79c4709f64e232cb7acf60fb.zip
no need to bzip smallish patches
Package-Manager: portage-2.1_pre3-r1
Diffstat (limited to 'app-text/xpdf')
-rw-r--r--app-text/xpdf/ChangeLog12
-rw-r--r--app-text/xpdf/Manifest26
-rw-r--r--app-text/xpdf/files/xpdf-3.00-PathScanner.patch125
-rw-r--r--app-text/xpdf/files/xpdf-3.00-PathScanner.patch.bz2bin1003 -> 0 bytes
-rw-r--r--app-text/xpdf/files/xpdf-3.00-core.patch13
-rw-r--r--app-text/xpdf/files/xpdf-3.00-core.patch.bz2bin271 -> 0 bytes
-rw-r--r--app-text/xpdf/files/xpdf-3.00-overflow.patch296
-rw-r--r--app-text/xpdf/files/xpdf-3.00-overflow.patch.bz2bin2097 -> 0 bytes
-rw-r--r--app-text/xpdf/files/xpdf-3.00-scroll-opts.patch185
-rw-r--r--app-text/xpdf/files/xpdf-3.00-scroll-opts.patch.bz2bin1869 -> 0 bytes
-rw-r--r--app-text/xpdf/files/xpdf-3.00-truetype-new.diff98
-rw-r--r--app-text/xpdf/files/xpdf-3.00-truetype-new.diff.gzbin1271 -> 0 bytes
-rw-r--r--app-text/xpdf/xpdf-3.00-r10.ebuild14
-rw-r--r--app-text/xpdf/xpdf-3.00-r8.ebuild14
14 files changed, 750 insertions, 33 deletions
diff --git a/app-text/xpdf/ChangeLog b/app-text/xpdf/ChangeLog
index 75cc03fe4dd4..69bae59990cb 100644
--- a/app-text/xpdf/ChangeLog
+++ b/app-text/xpdf/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for app-text/xpdf
# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/xpdf/ChangeLog,v 1.124 2006/01/25 23:06:37 kloeri Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-text/xpdf/ChangeLog,v 1.125 2006/01/28 14:43:26 blubb Exp $
+
+ 28 Jan 2006; Simon Stelling <blubb@gentoo.org>
+ +files/xpdf-3.00-PathScanner.patch,
+ -files/xpdf-3.00-PathScanner.patch.bz2, +files/xpdf-3.00-core.patch,
+ -files/xpdf-3.00-core.patch.bz2, +files/xpdf-3.00-overflow.patch,
+ -files/xpdf-3.00-overflow.patch.bz2, +files/xpdf-3.00-scroll-opts.patch,
+ -files/xpdf-3.00-scroll-opts.patch.bz2,
+ +files/xpdf-3.00-truetype-new.diff, -files/xpdf-3.00-truetype-new.diff.gz,
+ xpdf-3.00-r8.ebuild, xpdf-3.00-r10.ebuild:
+ no need to bzip smallish patches
25 Jan 2006; Bryan Østergaard <kloeri@gentoo.org xpdf-3.01-r5.ebuild:
Stable on alpha, bug 117495.
diff --git a/app-text/xpdf/Manifest b/app-text/xpdf/Manifest
index 721b27117c0e..ecda00b9fc96 100644
--- a/app-text/xpdf/Manifest
+++ b/app-text/xpdf/Manifest
@@ -1,7 +1,4 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-MD5 4bddd134bc967ce40ff31381f68315d3 ChangeLog 15081
+MD5 ada661ca564b23f0cf881435a6758bd5 ChangeLog 15581
MD5 ec978d9450f061ea49ee697b39d545bf files/digest-xpdf-3.00-r10 767
MD5 ec978d9450f061ea49ee697b39d545bf files/digest-xpdf-3.00-r8 767
MD5 fb31167789c80b1a01d773fc5108c356 files/digest-xpdf-3.01 767
@@ -11,19 +8,19 @@ MD5 fb31167789c80b1a01d773fc5108c356 files/digest-xpdf-3.01-r4 767
MD5 fb31167789c80b1a01d773fc5108c356 files/digest-xpdf-3.01-r5 767
MD5 fb31167789c80b1a01d773fc5108c356 files/digest-xpdf-3.01-r6 767
MD5 24d9ec970f2b8178c64f7150be0d7ace files/xpdf-3.00-64bit.patch 1304
-MD5 41c050cd5c7ccdcf1676a6852c7a35ed files/xpdf-3.00-PathScanner.patch.bz2 1003
-MD5 3df9058a9971c09627e71dad6b056244 files/xpdf-3.00-core.patch.bz2 271
+MD5 a80ebb2f6574bbcbe5826028edfe8f28 files/xpdf-3.00-PathScanner.patch 3225
+MD5 8524f477885c0a9e6b397d83da4ab661 files/xpdf-3.00-core.patch 317
MD5 8221707abac9c48b486b8c2b9bc7a7a0 files/xpdf-3.00-empty-bookmark.patch 373
MD5 a0e8c344d40384d23af93a7b7a2adba7 files/xpdf-3.00-fonts.patch 399
MD5 1ca86139c360680d756c771b7c6c8647 files/xpdf-3.00-freetype-2.1.7.patch 2743
MD5 e07939dc8546a450c5d8aca6263ad8ee files/xpdf-3.00-gcc41.patch 890
MD5 f200f24c7cfa6061337dc6c0e03f36b9 files/xpdf-3.00-nodrm.diff 1049
-MD5 c3d50c3fb232fe51c2ae06ff1f530d49 files/xpdf-3.00-overflow.patch.bz2 2097
+MD5 5e63c86e19a1c1387cab38b7e2902c9e files/xpdf-3.00-overflow.patch 8115
MD5 dd4a7f876f8002dc835dab94f7fcefc1 files/xpdf-3.00-pl2.patch 1665
MD5 ae2950dd45961a041a23aae7f740815b files/xpdf-3.00-pl3.patch 356
-MD5 9a40ac2946ebb4599602f43e10f88786 files/xpdf-3.00-scroll-opts.patch.bz2 1869
+MD5 47a6dbee52353a95ac7974c6f44594f0 files/xpdf-3.00-scroll-opts.patch 6347
MD5 8aec20a56895c25a8c2c35c16211d731 files/xpdf-3.00-security-can-2005-2097.patch 1612
-MD5 37f0b42aad269cb5896773b47b1d83ac files/xpdf-3.00-truetype-new.diff.gz 1271
+MD5 5710ee134d1bb9566a577e33e206b980 files/xpdf-3.00-truetype-new.diff 3153
MD5 8bcdee9af356073f2e0dd88071379148 files/xpdf-3.01-crash.patch 1057
MD5 ecab3568f87fdb4d4cd4fe2168949035 files/xpdf-3.01-nodrm.patch 3183
MD5 34c377b9f408fcfccb9b5513c98a6b1f files/xpdf-3.01-onlyx.patch 3099
@@ -34,18 +31,11 @@ MD5 4184783da2885ecde3c2256de5144555 files/xpdf-3.01pl1.patch 4936
MD5 2fce5bedd61300fad1566a41f991a782 files/xpdf-goo-sizet.patch 1424
MD5 a21a0caeb7356fb3e68e5db195a505e9 files/xpdfrc.1 1587
MD5 26b4b081d538c195dc39bcb2ec8e6f3a metadata.xml 161
-MD5 4baf6cdd9480cd938afaede8334c7a72 xpdf-3.00-r10.ebuild 3909
-MD5 0e303cf49620828eff323b0251d0141c xpdf-3.00-r8.ebuild 3622
+MD5 bff406cdadf08ba68f85b540cf3dae8a xpdf-3.00-r10.ebuild 3889
+MD5 3fb7356d4cc716ecc4d2b50719472646 xpdf-3.00-r8.ebuild 3602
MD5 3045b88b069de08b88a1c5c25b8caea6 xpdf-3.01-r1.ebuild 3562
MD5 a563cb37418209e3fac5f026184a916f xpdf-3.01-r3.ebuild 3912
MD5 b8ab9f515f3b5126dcc64ff0a428f30c xpdf-3.01-r4.ebuild 3683
MD5 5851c6a89bce6b96ca5d0a059ae9882a xpdf-3.01-r5.ebuild 3681
MD5 4375ad647a43933c4e1362d3bd9da6cc xpdf-3.01-r6.ebuild 4497
MD5 763deff18a7e6e7125aca1f3d6be3229 xpdf-3.01.ebuild 3529
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.2 (GNU/Linux)
-
-iD8DBQFD2ATRugEuf3OQ0akRAqNrAJ0WaiDhxICavdEt+wsryQKoAAaK8ACfWTuO
-DwW5M5q4bSRt6nIRd2C0pso=
-=OZqI
------END PGP SIGNATURE-----
diff --git a/app-text/xpdf/files/xpdf-3.00-PathScanner.patch b/app-text/xpdf/files/xpdf-3.00-PathScanner.patch
new file mode 100644
index 000000000000..dac7bfa34ad2
--- /dev/null
+++ b/app-text/xpdf/files/xpdf-3.00-PathScanner.patch
@@ -0,0 +1,125 @@
+--- xpdf-3.00/splash/Splash.cc.orig 2004-10-19 11:50:09.000000000 +0200
++++ xpdf-3.00/splash/Splash.cc 2004-10-19 11:50:46.000000000 +0200
+@@ -631,6 +631,9 @@
+ if (path->length == 0) {
+ return splashErrEmptyPath;
+ }
++ if (path->length == 1)
++ return splashErrBogusPath;
++
+ xPath = new SplashXPath(path, state->flatness, gTrue);
+ xPath->sort();
+ scanner = new SplashXPathScanner(xPath, eo);
+--- xpdf-3.00/splash/SplashXPathScanner.cc.orig 2004-10-21 16:36:41.170525604 +0200
++++ xpdf-3.00/splash/SplashXPathScanner.cc 2004-10-21 17:34:05.320376896 +0200
+@@ -39,54 +39,60 @@
+ xPath = xPathA;
+ eo = eoA;
+
++ xMin = 0;
++ xMax = 0;
++ yMin = 0;
++ yMax = 0;
++ interY = 0;
++ xPathIdx = 0;
++ inter = NULL;
++ interLen = interSize = 0;
++
+ // compute the bbox
+ seg = &xPath->segs[0];
+- if (seg->x0 <= seg->x1) {
+- xMinFP = seg->x0;
+- xMaxFP = seg->x1;
+- } else {
+- xMinFP = seg->x1;
+- xMaxFP = seg->x0;
+- }
+- if (seg->flags & splashXPathFlip) {
+- yMinFP = seg->y1;
+- yMaxFP = seg->y0;
+- } else {
+- yMinFP = seg->y0;
+- yMaxFP = seg->y1;
+- }
+- for (i = 1; i < xPath->length; ++i) {
+- seg = &xPath->segs[i];
+- if (seg->x0 < xMinFP) {
++ if (seg) {
++ if (seg->x0 <= seg->x1) {
+ xMinFP = seg->x0;
+- } else if (seg->x0 > xMaxFP) {
+- xMaxFP = seg->x0;
+- }
+- if (seg->x1 < xMinFP) {
+- xMinFP = seg->x1;
+- } else if (seg->x1 > xMaxFP) {
+ xMaxFP = seg->x1;
++ } else {
++ xMinFP = seg->x1;
++ xMaxFP = seg->x0;
+ }
+ if (seg->flags & splashXPathFlip) {
+- if (seg->y0 > yMaxFP) {
+- yMaxFP = seg->y0;
+- }
++ yMinFP = seg->y1;
++ yMaxFP = seg->y0;
+ } else {
+- if (seg->y1 > yMaxFP) {
+- yMaxFP = seg->y1;
++ yMinFP = seg->y0;
++ yMaxFP = seg->y1;
++ }
++ for (i = 1; i < xPath->length; ++i) {
++ seg = &xPath->segs[i];
++ if (seg->x0 < xMinFP) {
++ xMinFP = seg->x0;
++ } else if (seg->x0 > xMaxFP) {
++ xMaxFP = seg->x0;
++ }
++ if (seg->x1 < xMinFP) {
++ xMinFP = seg->x1;
++ } else if (seg->x1 > xMaxFP) {
++ xMaxFP = seg->x1;
++ }
++ if (seg->flags & splashXPathFlip) {
++ if (seg->y0 > yMaxFP) {
++ yMaxFP = seg->y0;
++ }
++ } else {
++ if (seg->y1 > yMaxFP) {
++ yMaxFP = seg->y1;
++ }
+ }
+ }
++ xMin = splashFloor(xMinFP);
++ xMax = splashFloor(xMaxFP);
++ yMin = splashFloor(yMinFP);
++ yMax = splashFloor(yMaxFP);
++ computeIntersections(yMin);
+ }
+- xMin = splashFloor(xMinFP);
+- xMax = splashFloor(xMaxFP);
+- yMin = splashFloor(yMinFP);
+- yMax = splashFloor(yMaxFP);
+-
+- interY = 0;
+- xPathIdx = 0;
+- inter = NULL;
+- interLen = interSize = 0;
+- computeIntersections(yMin);
+ }
+
+ SplashXPathScanner::~SplashXPathScanner() {
+--- xpdf-3.00/splash/SplashFTFont.cc.orig 2004-10-19 11:50:55.000000000 +0200
++++ xpdf-3.00/splash/SplashFTFont.cc 2004-10-19 11:51:12.000000000 +0200
+@@ -225,6 +225,9 @@
+ if (FT_Get_Glyph(slot, &glyph)) {
+ return NULL;
+ }
++ if (glyph->format != FT_GLYPH_FORMAT_OUTLINE) {
++ return NULL;
++ }
+ path = new SplashPath();
+ FT_Outline_Decompose(&((FT_OutlineGlyph)glyph)->outline,
+ &outlineFuncs, path);
diff --git a/app-text/xpdf/files/xpdf-3.00-PathScanner.patch.bz2 b/app-text/xpdf/files/xpdf-3.00-PathScanner.patch.bz2
deleted file mode 100644
index 9f87d6d5e78d..000000000000
--- a/app-text/xpdf/files/xpdf-3.00-PathScanner.patch.bz2
+++ /dev/null
Binary files differ
diff --git a/app-text/xpdf/files/xpdf-3.00-core.patch b/app-text/xpdf/files/xpdf-3.00-core.patch
new file mode 100644
index 000000000000..21e614821a71
--- /dev/null
+++ b/app-text/xpdf/files/xpdf-3.00-core.patch
@@ -0,0 +1,13 @@
+--- xpdf-3.00/xpdf/XPDFCore.cc.ud 2004-10-07 12:44:23.000000000 -0700
++++ xpdf-3.00/xpdf/XPDFCore.cc 2004-10-07 12:44:26.000000000 -0700
+@@ -1051,6 +1051,10 @@
+ GString *msg;
+ int i;
+
++ if (action == NULL)
++ // Nothing to do.
++ return;
++
+ switch (kind = action->getKind()) {
+
+ // GoTo / GoToR action
diff --git a/app-text/xpdf/files/xpdf-3.00-core.patch.bz2 b/app-text/xpdf/files/xpdf-3.00-core.patch.bz2
deleted file mode 100644
index 0e63c30e3ade..000000000000
--- a/app-text/xpdf/files/xpdf-3.00-core.patch.bz2
+++ /dev/null
Binary files differ
diff --git a/app-text/xpdf/files/xpdf-3.00-overflow.patch b/app-text/xpdf/files/xpdf-3.00-overflow.patch
new file mode 100644
index 000000000000..d1b2f584d812
--- /dev/null
+++ b/app-text/xpdf/files/xpdf-3.00-overflow.patch
@@ -0,0 +1,296 @@
+--- xpdf-3.00/xpdf/Catalog.cc.orig 2004-10-18 16:51:35.824126848 +0200
++++ xpdf-3.00/xpdf/Catalog.cc 2004-10-18 16:53:06.634620045 +0200
+@@ -64,6 +64,15 @@
+ }
+ pagesSize = numPages0 = (int)obj.getNum();
+ obj.free();
++ // The gcc doesnt optimize this away, so this check is ok,
++ // even if it looks like a pagesSize != pagesSize check
++ if (pagesSize*sizeof(Page *)/sizeof(Page *) != pagesSize ||
++ pagesSize*sizeof(Ref)/sizeof(Ref) != pagesSize) {
++ error(-1, "Invalid 'pagesSize'");
++ ok = gFalse;
++ return;
++ }
++
+ pages = (Page **)gmalloc(pagesSize * sizeof(Page *));
+ pageRefs = (Ref *)gmalloc(pagesSize * sizeof(Ref));
+ for (i = 0; i < pagesSize; ++i) {
+@@ -191,6 +200,11 @@
+ }
+ if (start >= pagesSize) {
+ pagesSize += 32;
++ if (pagesSize*sizeof(Page *)/sizeof(Page *) != pagesSize ||
++ pagesSize*sizeof(Ref)/sizeof(Ref) != pagesSize) {
++ error(-1, "Invalid 'pagesSize' parameter.");
++ goto err3;
++ }
+ pages = (Page **)grealloc(pages, pagesSize * sizeof(Page *));
+ pageRefs = (Ref *)grealloc(pageRefs, pagesSize * sizeof(Ref));
+ for (j = pagesSize - 32; j < pagesSize; ++j) {
+--- xpdf-3.00/xpdf/XRef.cc.orig 2004-10-11 15:51:14.000000000 +0200
++++ xpdf-3.00/xpdf/XRef.cc 2004-10-11 15:56:48.000000000 +0200
+@@ -96,7 +96,7 @@
+ }
+ nObjects = obj1.getInt();
+ obj1.free();
+- if (nObjects == 0) {
++ if (nObjects <= 0) {
+ goto err1;
+ }
+
+@@ -106,7 +106,15 @@
+ }
+ first = obj1.getInt();
+ obj1.free();
++ if (first < 0) {
++ goto err1;
++ }
+
++ if (nObjects*sizeof(int)/sizeof(int) != nObjects) {
++ error(-1, "Invalid 'nObjects'");
++ goto err1;
++ }
++
+ objs = new Object[nObjects];
+ objNums = (int *)gmalloc(nObjects * sizeof(int));
+ offsets = (int *)gmalloc(nObjects * sizeof(int));
+@@ -130,6 +138,12 @@
+ offsets[i] = obj2.getInt();
+ obj1.free();
+ obj2.free();
++ if (objNums[i] < 0 || offsets[i] < 0 ||
++ (i > 0 && offsets[i] < offsets[i-1])) {
++ delete parser;
++ gfree(offsets);
++ goto err1;
++ }
+ }
+ while (str->getChar() != EOF) ;
+ delete parser;
+@@ -369,10 +383,21 @@
+ }
+ n = obj.getInt();
+ obj.free();
++ if (first < 0 || n < 0 || first + n < 0) {
++ goto err1;
++ }
+ if (first + n > size) {
+ for (newSize = size ? 2 * size : 1024;
+- first + n > newSize;
++ first + n > newSize && newSize > 0;
+ newSize <<= 1) ;
++ if (newSize < 0) {
++ goto err1;
++ }
++ if (newSize*sizeof(XRefEntry)/sizeof(XRefEntry) != newSize) {
++ error(-1, "Invalid 'obj' parameters'");
++ goto err1;
++ }
++
+ entries = (XRefEntry *)grealloc(entries, newSize * sizeof(XRefEntry));
+ for (i = size; i < newSize; ++i) {
+ entries[i].offset = 0xffffffff;
+@@ -443,7 +468,7 @@
+
+ // check for an 'XRefStm' key
+ if (obj.getDict()->lookup("XRefStm", &obj2)->isInt()) {
+- pos2 = obj2.getInt();
++ pos2 = (Guint)obj2.getInt();
+ readXRef(&pos2);
+ if (!ok) {
+ goto err1;
+@@ -474,7 +499,14 @@
+ }
+ newSize = obj.getInt();
+ obj.free();
++ if (newSize < 0) {
++ goto err1;
++ }
+ if (newSize > size) {
++ if (newSize * sizeof(XRefEntry)/sizeof(XRefEntry) != newSize) {
++ error(-1, "Invalid 'size' parameter.");
++ return gFalse;
++ }
+ entries = (XRefEntry *)grealloc(entries, newSize * sizeof(XRefEntry));
+ for (i = size; i < newSize; ++i) {
+ entries[i].offset = 0xffffffff;
+@@ -494,6 +526,9 @@
+ }
+ w[i] = obj2.getInt();
+ obj2.free();
++ if (w[i] < 0 || w[i] > 4) {
++ goto err1;
++ }
+ }
+ obj.free();
+
+@@ -513,13 +548,14 @@
+ }
+ n = obj.getInt();
+ obj.free();
+- if (!readXRefStreamSection(xrefStr, w, first, n)) {
++ if (first < 0 || n < 0 ||
++ !readXRefStreamSection(xrefStr, w, first, n)) {
+ idx.free();
+ goto err0;
+ }
+ }
+ } else {
+- if (!readXRefStreamSection(xrefStr, w, 0, size)) {
++ if (!readXRefStreamSection(xrefStr, w, 0, newSize)) {
+ idx.free();
+ goto err0;
+ }
+@@ -551,10 +587,20 @@
+ Guint offset;
+ int type, gen, c, newSize, i, j;
+
++ if (first + n < 0) {
++ return gFalse;
++ }
+ if (first + n > size) {
+ for (newSize = size ? 2 * size : 1024;
+- first + n > newSize;
++ first + n > newSize && newSize > 0;
+ newSize <<= 1) ;
++ if (newSize < 0) {
++ return gFalse;
++ }
++ if (newSize*sizeof(XRefEntry)/sizeof(XRefEntry) != newSize) {
++ error(-1, "Invalid 'size' inside xref table.");
++ return gFalse;
++ }
+ entries = (XRefEntry *)grealloc(entries, newSize * sizeof(XRefEntry));
+ for (i = size; i < newSize; ++i) {
+ entries[i].offset = 0xffffffff;
+@@ -585,24 +631,26 @@
+ }
+ gen = (gen << 8) + c;
+ }
+- switch (type) {
+- case 0:
+- entries[i].offset = offset;
+- entries[i].gen = gen;
+- entries[i].type = xrefEntryFree;
+- break;
+- case 1:
+- entries[i].offset = offset;
+- entries[i].gen = gen;
+- entries[i].type = xrefEntryUncompressed;
+- break;
+- case 2:
+- entries[i].offset = offset;
+- entries[i].gen = gen;
+- entries[i].type = xrefEntryCompressed;
+- break;
+- default:
+- return gFalse;
++ if (entries[i].offset == 0xffffffff) {
++ switch (type) {
++ case 0:
++ entries[i].offset = offset;
++ entries[i].gen = gen;
++ entries[i].type = xrefEntryFree;
++ break;
++ case 1:
++ entries[i].offset = offset;
++ entries[i].gen = gen;
++ entries[i].type = xrefEntryUncompressed;
++ break;
++ case 2:
++ entries[i].offset = offset;
++ entries[i].gen = gen;
++ entries[i].type = xrefEntryCompressed;
++ break;
++ default:
++ return gFalse;
++ }
+ }
+ }
+
+@@ -664,38 +712,48 @@
+ // look for object
+ } else if (isdigit(*p)) {
+ num = atoi(p);
+- do {
+- ++p;
+- } while (*p && isdigit(*p));
+- if (isspace(*p)) {
++ if (num > 0) {
+ do {
+ ++p;
+- } while (*p && isspace(*p));
+- if (isdigit(*p)) {
+- gen = atoi(p);
++ } while (*p && isdigit(*p));
++ if (isspace(*p)) {
+ do {
+ ++p;
+- } while (*p && isdigit(*p));
+- if (isspace(*p)) {
++ } while (*p && isspace(*p));
++ if (isdigit(*p)) {
++ gen = atoi(p);
+ do {
+ ++p;
+- } while (*p && isspace(*p));
+- if (!strncmp(p, "obj", 3)) {
+- if (num >= size) {
+- newSize = (num + 1 + 255) & ~255;
+- entries = (XRefEntry *)
+- grealloc(entries, newSize * sizeof(XRefEntry));
+- for (i = size; i < newSize; ++i) {
+- entries[i].offset = 0xffffffff;
+- entries[i].type = xrefEntryFree;
++ } while (*p && isdigit(*p));
++ if (isspace(*p)) {
++ do {
++ ++p;
++ } while (*p && isspace(*p));
++ if (!strncmp(p, "obj", 3)) {
++ if (num >= size) {
++ newSize = (num + 1 + 255) & ~255;
++ if (newSize < 0) {
++ error(-1, "Bad object number");
++ return gFalse;
++ }
++ if (newSize*sizeof(XRefEntry)/sizeof(XRefEntry) != newSize) {
++ error(-1, "Invalid 'obj' parameters.");
++ return gFalse;
++ }
++ entries = (XRefEntry *)
++ grealloc(entries, newSize * sizeof(XRefEntry));
++ for (i = size; i < newSize; ++i) {
++ entries[i].offset = 0xffffffff;
++ entries[i].type = xrefEntryFree;
++ }
++ size = newSize;
++ }
++ if (entries[num].type == xrefEntryFree ||
++ gen >= entries[num].gen) {
++ entries[num].offset = pos - start;
++ entries[num].gen = gen;
++ entries[num].type = xrefEntryUncompressed;
+ }
+- size = newSize;
+- }
+- if (entries[num].type == xrefEntryFree ||
+- gen >= entries[num].gen) {
+- entries[num].offset = pos - start;
+- entries[num].gen = gen;
+- entries[num].type = xrefEntryUncompressed;
+ }
+ }
+ }
+@@ -705,6 +763,10 @@
+ } else if (!strncmp(p, "endstream", 9)) {
+ if (streamEndsLen == streamEndsSize) {
+ streamEndsSize += 64;
++ if (streamEndsSize*sizeof(int)/sizeof(int) != streamEndsSize) {
++ error(-1, "Invalid 'endstream' parameter.");
++ return gFalse;
++ }
+ streamEnds = (Guint *)grealloc(streamEnds,
+ streamEndsSize * sizeof(int));
+ }
diff --git a/app-text/xpdf/files/xpdf-3.00-overflow.patch.bz2 b/app-text/xpdf/files/xpdf-3.00-overflow.patch.bz2
deleted file mode 100644
index 3527c2d80b96..000000000000
--- a/app-text/xpdf/files/xpdf-3.00-overflow.patch.bz2
+++ /dev/null
Binary files differ
diff --git a/app-text/xpdf/files/xpdf-3.00-scroll-opts.patch b/app-text/xpdf/files/xpdf-3.00-scroll-opts.patch
new file mode 100644
index 000000000000..9a661ea621c1
--- /dev/null
+++ b/app-text/xpdf/files/xpdf-3.00-scroll-opts.patch
@@ -0,0 +1,185 @@
+diff -ur xpdf-3.00.org/xpdf/GlobalParams.cc xpdf-3.00/xpdf/GlobalParams.cc
+--- xpdf-3.00.org/xpdf/GlobalParams.cc 2004-01-21 20:26:45.000000000 -0500
++++ xpdf-3.00/xpdf/GlobalParams.cc 2004-12-01 06:33:25.998677321 -0500
+@@ -234,6 +234,8 @@
+ enableT1lib = gTrue;
+ enableFreeType = gTrue;
+ antialias = gTrue;
++ scrollLines = 1;
++ scrollCols = 1;
+ urlCommand = NULL;
+ movieCommand = NULL;
+ mapNumericCharNames = gTrue;
+@@ -445,6 +447,10 @@
+ parseYesNo("antialias", &antialias, tokens, fileName, line);
+ } else if (!cmd->cmp("urlCommand")) {
+ parseCommand("urlCommand", &urlCommand, tokens, fileName, line);
++ } else if (!cmd->cmp("scrollLines")) {
++ parseInteger("scrollLines", &scrollLines, tokens, fileName, line);
++ } else if (!cmd->cmp("scrollCols")) {
++ parseInteger("scrollCols", &scrollCols, tokens, fileName, line);
+ } else if (!cmd->cmp("movieCommand")) {
+ parseCommand("movieCommand", &movieCommand, tokens, fileName, line);
+ } else if (!cmd->cmp("mapNumericCharNames")) {
+@@ -809,6 +815,38 @@
+ *val = ((GString *)tokens->get(1))->copy();
+ }
+
++void GlobalParams::parseInteger(char *cmdName, int *val,
++ GList *tokens, GString *fileName, int line) {
++ char *tok;
++ int value;
++ GBool invalid = gFalse;
++
++ if (tokens->getLength() != 2) {
++ error(-1, "Bad '%s' config file command (%s:%d)",
++ cmdName, fileName->getCString(), line);
++ return;
++ }
++ tok = ((GString*) tokens->get(1))->getCString();
++ value = atoi(tok);
++ if (value == 0) {
++ // Verify it's a valid 0 (ie, a string of only '0's)
++ if (*tok != '0')
++ invalid = gTrue;
++ while (!invalid && *tok != '\0')
++ {
++ if (*tok != '0')
++ invalid = gTrue;
++ tok++;
++ }
++ if (invalid) {
++ error(-1, "Bad '%s' config file command (%s:%d)",
++ cmdName, fileName->getCString(), line);
++ return;
++ }
++ }
++ *val = value;
++}
++
+ void GlobalParams::parseYesNo(char *cmdName, GBool *flag,
+ GList *tokens, GString *fileName, int line) {
+ GString *tok;
+diff -ur xpdf-3.00.org/xpdf/GlobalParams.h xpdf-3.00/xpdf/GlobalParams.h
+--- xpdf-3.00.org/xpdf/GlobalParams.h 2004-01-21 20:26:45.000000000 -0500
++++ xpdf-3.00/xpdf/GlobalParams.h 2004-12-01 06:38:10.489040100 -0500
+@@ -156,6 +156,8 @@
+ GBool getEnableFreeType();
+ GBool getAntialias();
+ GString *getURLCommand() { return urlCommand; }
++ int getScrollLines() { return scrollLines; }
++ int getScrollCols() { return scrollCols; }
+ GString *getMovieCommand() { return movieCommand; }
+ GBool getMapNumericCharNames();
+ GBool getPrintCommands();
+@@ -224,6 +226,8 @@
+ void parseInitialZoom(GList *tokens, GString *fileName, int line);
+ void parseCommand(char *cmdName, GString **val,
+ GList *tokens, GString *fileName, int line);
++ void parseInteger(char *cmdName, int *val,
++ GList *tokens, GString *fileName, int line);
+ void parseYesNo(char *cmdName, GBool *flag,
+ GList *tokens, GString *fileName, int line);
+ GBool parseYesNo2(char *token, GBool *flag);
+@@ -290,6 +294,8 @@
+ GBool enableT1lib; // t1lib enable flag
+ GBool enableFreeType; // FreeType enable flag
+ GBool antialias; // anti-aliasing enable flag
++ int scrollLines; // How many lines to scroll
++ int scrollCols; // How many columns to scroll
+ GString *urlCommand; // command executed for URL links
+ GString *movieCommand; // command executed for movie annotations
+ GBool mapNumericCharNames; // map numeric char names (from font subsets)?
+diff -ur xpdf-3.00.org/xpdf/XPDFCore.cc xpdf-3.00/xpdf/XPDFCore.cc
+--- xpdf-3.00.org/xpdf/XPDFCore.cc 2004-01-21 20:26:45.000000000 -0500
++++ xpdf-3.00/xpdf/XPDFCore.cc 2004-12-01 06:38:54.614635025 -0500
+@@ -686,19 +686,35 @@
+ displayPage(history[historyCur].page, zoom, rotate, gFalse, gFalse);
+ }
+
+-void XPDFCore::scrollLeft(int nCols) {
++void XPDFCore::scrollLeft() {
++ scrollLeft_(globalParams->getScrollCols());
++}
++
++void XPDFCore::scrollLeft_(int nCols) {
+ scrollTo(scrollX - nCols * 16, scrollY);
+ }
+
+-void XPDFCore::scrollRight(int nCols) {
++void XPDFCore::scrollRight() {
++ scrollRight_(globalParams->getScrollCols());
++}
++
++void XPDFCore::scrollRight_(int nCols) {
+ scrollTo(scrollX + nCols * 16, scrollY);
+ }
+
+-void XPDFCore::scrollUp(int nLines) {
++void XPDFCore::scrollUp() {
++ scrollUp_(globalParams->getScrollLines());
++}
++
++void XPDFCore::scrollUp_(int nLines) {
+ scrollTo(scrollX, scrollY - nLines * 16);
+ }
+
+-void XPDFCore::scrollDown(int nLines) {
++void XPDFCore::scrollDown() {
++ scrollDown_(globalParams->getScrollLines());
++}
++
++void XPDFCore::scrollDown_(int nLines) {
+ scrollTo(scrollX, scrollY + nLines * 16);
+ }
+
+@@ -1613,7 +1629,7 @@
+ } else if (core->scrollY == 0) {
+ core->gotoPrevPage(1, gFalse, gTrue);
+ } else {
+- core->scrollUp(1);
++ core->scrollUp();
+ }
+ } else if (data->event->xbutton.button == 5) { // mouse wheel down
+ if (core->fullScreen ||
+@@ -1621,15 +1637,15 @@
+ core->out->getBitmapHeight() - core->drawAreaHeight) {
+ core->gotoNextPage(1, gTrue);
+ } else {
+- core->scrollDown(1);
++ core->scrollDown();
+ }
+ } else if (data->event->xbutton.button == 6) { // second mouse wheel left
+ if (!core->fullScreen) {
+- core->scrollLeft(1);
++ core->scrollLeft();
+ }
+ } else if (data->event->xbutton.button == 7) { // second mouse wheel right
+ if (!core->fullScreen) {
+- core->scrollRight(1);
++ core->scrollRight();
+ }
+ } else {
+ if (*core->mouseCbk) {
+diff -ur xpdf-3.00.org/xpdf/XPDFCore.h xpdf-3.00/xpdf/XPDFCore.h
+--- xpdf-3.00.org/xpdf/XPDFCore.h 2004-01-21 20:26:45.000000000 -0500
++++ xpdf-3.00/xpdf/XPDFCore.h 2004-12-01 06:19:08.566433277 -0500
+@@ -126,10 +126,14 @@
+ void gotoPrevPage(int dec, GBool top, GBool bottom);
+ void goForward();
+ void goBackward();
+- void scrollLeft(int nCols = 1);
+- void scrollRight(int nCols = 1);
+- void scrollUp(int nLines = 1);
+- void scrollDown(int nLines = 1);
++ void scrollLeft();
++ void scrollRight();
++ void scrollUp();
++ void scrollDown();
++ void scrollLeft_(int nCols = 1);
++ void scrollRight_(int nCols = 1);
++ void scrollUp_(int nLines = 1);
++ void scrollDown_(int nLines = 1);
+ void scrollPageUp();
+ void scrollPageDown();
+ void scrollTo(int x, int y);
diff --git a/app-text/xpdf/files/xpdf-3.00-scroll-opts.patch.bz2 b/app-text/xpdf/files/xpdf-3.00-scroll-opts.patch.bz2
deleted file mode 100644
index 205abd845f01..000000000000
--- a/app-text/xpdf/files/xpdf-3.00-scroll-opts.patch.bz2
+++ /dev/null
Binary files differ
diff --git a/app-text/xpdf/files/xpdf-3.00-truetype-new.diff b/app-text/xpdf/files/xpdf-3.00-truetype-new.diff
new file mode 100644
index 000000000000..73d22e81e394
--- /dev/null
+++ b/app-text/xpdf/files/xpdf-3.00-truetype-new.diff
@@ -0,0 +1,98 @@
+diff -ruN xpdf.orig/CharCodeToUnicode.h xpdf/CharCodeToUnicode.h
+--- xpdf.orig/CharCodeToUnicode.h 2004-01-21 17:26:45.000000000 -0800
++++ xpdf/CharCodeToUnicode.h 2004-02-12 14:05:30.591633392 -0800
+@@ -67,6 +67,10 @@
+ // Map a CharCode to Unicode.
+ int mapToUnicode(CharCode c, Unicode *u, int size);
+
++ // Return the mapping's length, i.e., one more than the max char
++ // code supported by the mapping.
++ CharCode getLength() { return mapLen; }
++
+ private:
+
+ void parseCMap1(int (*getCharFunc)(void *), void *data, int nBits);
+diff -ruN xpdf.orig/SplashOutputDev.cc xpdf/SplashOutputDev.cc
+--- xpdf.orig/SplashOutputDev.cc 2004-01-21 17:26:45.000000000 -0800
++++ xpdf/SplashOutputDev.cc 2004-02-12 14:05:30.602631720 -0800
+@@ -497,15 +497,18 @@
+ FILE *tmpFile;
+ Gushort *codeToGID;
+ DisplayFontParam *dfp;
++ CharCodeToUnicode *ctu;
+ double m11, m12, m21, m22, w1, w2;
+ SplashCoord mat[4];
+ char *name;
+- int c, substIdx, n, code;
++ Unicode uBuf[8];
++ int c, substIdx, n, code, cmap;
+
+ needFontUpdate = gFalse;
+ font = NULL;
+ tmpFileName = NULL;
+ substIdx = -1;
++ dfp = NULL;
+
+ if (!(gfxFont = state->getFont())) {
+ goto err1;
+@@ -544,7 +547,6 @@
+ } else if (!(fileName = gfxFont->getExtFontFile())) {
+
+ // look for a display font mapping or a substitute font
+- dfp = NULL;
+ if (gfxFont->isCIDFont()) {
+ if (((GfxCIDFont *)gfxFont)->getCollection()) {
+ dfp = globalParams->
+@@ -650,10 +652,48 @@
+ }
+ break;
+ case fontCIDType2:
+- n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
+- codeToGID = (Gushort *)gmalloc(n * sizeof(Gushort));
+- memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
+- n * sizeof(Gushort));
++ codeToGID = NULL;
++ n = 0;
++ if (dfp) {
++ // create a CID-to-GID mapping, via Unicode
++ if ((ctu = ((GfxCIDFont *)gfxFont)->getToUnicode())) {
++ if ((ff = FoFiTrueType::load(fileName->getCString()))) {
++ // look for a Unicode cmap
++ for (cmap = 0; cmap < ff->getNumCmaps(); ++cmap) {
++ if ((ff->getCmapPlatform(cmap) == 3 &&
++ ff->getCmapEncoding(cmap) == 1) ||
++ ff->getCmapPlatform(cmap) == 0) {
++ break;
++ }
++ }
++ if (cmap < ff->getNumCmaps()) {
++ // map CID -> Unicode -> GID
++ n = ctu->getLength();
++ codeToGID = (Gushort *)gmalloc(n * sizeof(Gushort));
++ for (code = 0; code < n; ++code) {
++ if (ctu->mapToUnicode(code, uBuf, 8) > 0) {
++ codeToGID[code] = ff->mapCodeToGID(cmap, uBuf[0]);
++ } else {
++ codeToGID[code] = 0;
++ }
++ }
++ }
++ delete ff;
++ }
++ ctu->decRefCnt();
++ } else {
++ error(-1, "Couldn't find a mapping to Unicode for font '%s'",
++ gfxFont->getName() ? gfxFont->getName()->getCString()
++ : "(unnamed)");
++ }
++ } else {
++ if (((GfxCIDFont *)gfxFont)->getCIDToGID()) {
++ n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
++ codeToGID = (Gushort *)gmalloc(n * sizeof(Gushort));
++ memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
++ n * sizeof(Gushort));
++ }
++ }
+ if (!(fontFile = fontEngine->loadTrueTypeFont(
+ id,
+ fileName->getCString(),
diff --git a/app-text/xpdf/files/xpdf-3.00-truetype-new.diff.gz b/app-text/xpdf/files/xpdf-3.00-truetype-new.diff.gz
deleted file mode 100644
index 17b48a904349..000000000000
--- a/app-text/xpdf/files/xpdf-3.00-truetype-new.diff.gz
+++ /dev/null
Binary files differ
diff --git a/app-text/xpdf/xpdf-3.00-r10.ebuild b/app-text/xpdf/xpdf-3.00-r10.ebuild
index 54a7d62340a1..9249894fec6f 100644
--- a/app-text/xpdf/xpdf-3.00-r10.ebuild
+++ b/app-text/xpdf/xpdf-3.00-r10.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2005 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/xpdf/xpdf-3.00-r10.ebuild,v 1.8 2005/08/14 03:54:21 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-text/xpdf/xpdf-3.00-r10.ebuild,v 1.9 2006/01/28 14:43:26 blubb Exp $
inherit eutils
@@ -51,15 +51,15 @@ PROVIDE="virtual/pdfviewer"
src_unpack() {
unpack ${A}
cd ${S}
- use truetype && epatch ${FILESDIR}/xpdf-3.00-truetype-new.diff.gz
+ use truetype && epatch ${FILESDIR}/xpdf-3.00-truetype-new.diff
use truetype && epatch ${FILESDIR}/xpdf-3.00-freetype-2.1.7.patch
epatch ${FILESDIR}/xpdf-3.00-empty-bookmark.patch
- epatch ${FILESDIR}/xpdf-3.00-core.patch.bz2
- epatch ${FILESDIR}/xpdf-3.00-overflow.patch.bz2
- epatch ${FILESDIR}/xpdf-3.00-PathScanner.patch.bz2
+ epatch ${FILESDIR}/xpdf-3.00-core.patch
+ epatch ${FILESDIR}/xpdf-3.00-overflow.patch
+ epatch ${FILESDIR}/xpdf-3.00-PathScanner.patch
use nodrm && epatch ${FILESDIR}/xpdf-3.00-nodrm.diff
epatch ${FILESDIR}/xpdf-goo-sizet.patch
- epatch ${FILESDIR}/xpdf-3.00-scroll-opts.patch.bz2
+ epatch ${FILESDIR}/xpdf-3.00-scroll-opts.patch
epatch ${FILESDIR}/xpdf-3.00-pl2.patch
epatch ${FILESDIR}/xpdf-3.00-pl3.patch
epatch ${FILESDIR}/xpdf-3.00-fonts.patch
diff --git a/app-text/xpdf/xpdf-3.00-r8.ebuild b/app-text/xpdf/xpdf-3.00-r8.ebuild
index 6478fcc54699..9c04523ac9f9 100644
--- a/app-text/xpdf/xpdf-3.00-r8.ebuild
+++ b/app-text/xpdf/xpdf-3.00-r8.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2005 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/xpdf/xpdf-3.00-r8.ebuild,v 1.17 2005/06/08 16:55:23 lanius Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-text/xpdf/xpdf-3.00-r8.ebuild,v 1.18 2006/01/28 14:43:26 blubb Exp $
inherit eutils
@@ -49,15 +49,15 @@ PROVIDE="virtual/pdfviewer"
src_unpack() {
unpack ${A}
cd ${S}
- epatch ${FILESDIR}/xpdf-3.00-truetype-new.diff.gz
+ epatch ${FILESDIR}/xpdf-3.00-truetype-new.diff
epatch ${FILESDIR}/xpdf-3.00-freetype-2.1.7.patch
epatch ${FILESDIR}/xpdf-3.00-empty-bookmark.patch
- epatch ${FILESDIR}/xpdf-3.00-core.patch.bz2
- epatch ${FILESDIR}/xpdf-3.00-overflow.patch.bz2
- epatch ${FILESDIR}/xpdf-3.00-PathScanner.patch.bz2
+ epatch ${FILESDIR}/xpdf-3.00-core.patch
+ epatch ${FILESDIR}/xpdf-3.00-overflow.patch
+ epatch ${FILESDIR}/xpdf-3.00-PathScanner.patch
use nodrm && epatch ${FILESDIR}/xpdf-3.00-nodrm.diff
epatch ${FILESDIR}/xpdf-goo-sizet.patch
- epatch ${FILESDIR}/xpdf-3.00-scroll-opts.patch.bz2
+ epatch ${FILESDIR}/xpdf-3.00-scroll-opts.patch
epatch ${FILESDIR}/xpdf-3.00-pl2.patch
epatch ${FILESDIR}/xpdf-3.00-pl3.patch
autoconf