Update to xpdf-3.03.

This commit is contained in:
kili 2011-10-01 19:46:35 +00:00
parent 177dda65a5
commit 4dd01b2023
13 changed files with 39 additions and 309 deletions

View File

@ -1,28 +1,22 @@
# $OpenBSD: Makefile,v 1.80 2011/09/16 11:41:42 espie Exp $
# $OpenBSD: Makefile,v 1.81 2011/10/01 19:46:35 kili Exp $
COMMENT-main= PDF viewer for X11
COMMENT-utils= PDF conversion tools
DISTNAME= xpdf-3.02
PKGNAME-main= xpdf-3.02.5
REVISION-main= 3
PKGNAME-utils= xpdf-utils-3.02.5
REVISION-utils = 0
DISTNAME= xpdf-3.03
PKGNAME-main= xpdf-3.03
PKGNAME-utils= xpdf-utils-3.03
CATEGORIES= textproc x11
MASTER_SITES= ftp://ftp.foolabs.com/pub/xpdf/ \
ftp://gd.tuwien.ac.at/publishing/xpdf/ \
ftp://tug.org/xpdf/
PATCHFILES= xpdf-3.02pl1.patch xpdf-3.02pl2.patch \
xpdf-3.02pl3.patch xpdf-3.02pl4.patch \
xpdf-3.02pl5.patch
PATCH_DIST_STRIP=-p1
http://mirror.ctan.org/support/xpdf/
HOMEPAGE= http://www.foolabs.com/xpdf/
MULTI_PACKAGES= -main -utils
# GPLv2
# GPLv2 only or GPLv3 only or both (at our choice)
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
@ -40,14 +34,13 @@ CONFIGURE_ENV= CPPFLAGS='-I${X11BASE}/include/freetype2 -I${X11BASE}/include -I
MAKE_ENV+=MOTIFLIB='-L${LOCALBASE}/lib -lXm'
LIB_DEPENDS-utils=
LIB_DEPENDS-main= devel/t1lib ${LIB_DEPENDS}
RUN_DEPENDS-utils= print/ghostscript/gnu-fonts
RUN_DEPENDS-main= ${RUN_DEPENDS-utils} \
${FULLPKGNAME-utils}:textproc/xpdf,-utils
WANTLIB-utils= c m pthread stdc++ z
WANTLIB-main= ${WANTLIB} ${WANTLIB-utils} ICE SM X11 Xext Xpm Xt \
freetype t1>=3 Xm
freetype Xm
NO_REGRESS= Yes

View File

@ -1,30 +1,5 @@
MD5 (xpdf-3.02.tar.gz) = WZ3EzGWgfuhoz5KmZ6kT0g==
MD5 (xpdf-3.02pl1.patch) = h3EYeG3+J9G3qlpnWcxuRQ==
MD5 (xpdf-3.02pl2.patch) = OlyxZa5meB4LIeYhmuBnlQ==
MD5 (xpdf-3.02pl3.patch) = WBlj7eD7VxXhpp8BtbjOYw==
MD5 (xpdf-3.02pl4.patch) = cLdScWeY3TQaS/iQ319v3A==
MD5 (xpdf-3.02pl5.patch) = UEkCyl6dZsZ+7QNjbsaxYw==
RMD160 (xpdf-3.02.tar.gz) = 6QDLhnC4xDC+qkWJX7R0QRyxlY0=
RMD160 (xpdf-3.02pl1.patch) = XDEPlnYPcunBBisAxXwu0DWsZ1c=
RMD160 (xpdf-3.02pl2.patch) = ACTj0gPWngc6RYVwzsVnniYK0gQ=
RMD160 (xpdf-3.02pl3.patch) = hZ7DEx08RSamB17mOcXrcEGUIRs=
RMD160 (xpdf-3.02pl4.patch) = QoBl6Mljm2eZcFsha+YD9S77iiI=
RMD160 (xpdf-3.02pl5.patch) = 9QKnxTEek18+Sl/Vt3C0TmjAmno=
SHA1 (xpdf-3.02.tar.gz) = +ZQGmIQMioBFZ36L5oq4WAkD4go=
SHA1 (xpdf-3.02pl1.patch) = zTyO1uH9NgYJi4XVzIp9GqMFJm0=
SHA1 (xpdf-3.02pl2.patch) = 0ILr4NNsrQwEYDlQIW9cUt4cJZM=
SHA1 (xpdf-3.02pl3.patch) = I/SWgEgCo9pTDx0Lq4lLrj6Tj8I=
SHA1 (xpdf-3.02pl4.patch) = GqMIehx4gohK59OlAiQKVazKZf0=
SHA1 (xpdf-3.02pl5.patch) = Cs1J5zu6R/oex7R5648TmKM+q7w=
SHA256 (xpdf-3.02.tar.gz) = szp9VvRUwzGuUJlvmJ6GyRZuV6+Xt03ijN3z1RrBHwA=
SHA256 (xpdf-3.02pl1.patch) = WPYTsAtBSoaqd2t2/NiZu0FeTuTtwhhMinxO0QBNu/M=
SHA256 (xpdf-3.02pl2.patch) = 0cHYh7C4pSg/BPgl5E8IXy6S2ve1GIiazxvInqB+2dk=
SHA256 (xpdf-3.02pl3.patch) = WUzo+9I7/ynqzd+uNTPGPH6GtKJPfUXkTxk309GeU0s=
SHA256 (xpdf-3.02pl4.patch) = sIRDlUETGHZu91CYd4f3eCMelLwV8E9/fRb0H9WBiLA=
SHA256 (xpdf-3.02pl5.patch) = kvyzCDoZ43swlpeAQ/rqjHd+eq7KODS4Mtmbwq8xcbo=
SIZE (xpdf-3.02.tar.gz) = 674912
SIZE (xpdf-3.02pl1.patch) = 1050
SIZE (xpdf-3.02pl2.patch) = 20843
SIZE (xpdf-3.02pl3.patch) = 30727
SIZE (xpdf-3.02pl4.patch) = 6982
SIZE (xpdf-3.02pl5.patch) = 1065
MD5 (xpdf-3.03.tar.gz) = r3X3cr7g5a5KgR/50D6sWg==
RMD160 (xpdf-3.03.tar.gz) = 7xM2wYkCb7Ds0Wnis3taWqIuBL4=
SHA1 (xpdf-3.03.tar.gz) = SZQj6KeV4O/XbKeYI5600NUv4kg=
SHA256 (xpdf-3.03.tar.gz) = As9j2PYybtpkQJbND5aeFYhwKthyIsHpOIqTwnD7zso=
SIZE (xpdf-3.03.tar.gz) = 795537

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-Makefile_in,v 1.1 2008/02/10 20:25:14 landry Exp $
--- Makefile.in.orig Mon Nov 12 11:33:36 2007
+++ Makefile.in Mon Nov 12 11:34:40 2007
@@ -94,13 +94,8 @@ install: dummy
$OpenBSD: patch-Makefile_in,v 1.2 2011/10/01 19:46:35 kili Exp $
--- Makefile.in.orig Mon Aug 15 23:08:52 2011
+++ Makefile.in Thu Aug 18 21:10:22 2011
@@ -102,13 +102,8 @@ install: dummy
$(INSTALL_DATA) $(srcdir)/doc/pdfimages.1 $(DESTDIR)@mandir@/man1/pdfimages.1
-mkdir -p $(DESTDIR)@mandir@/man5
$(INSTALL_DATA) $(srcdir)/doc/xpdfrc.5 $(DESTDIR)@mandir@/man5/xpdfrc.5

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-doc_sample-xpdfrc,v 1.3 2010/05/27 14:55:40 jasper Exp $
--- doc/sample-xpdfrc.orig Tue Feb 27 23:05:51 2007
+++ doc/sample-xpdfrc Thu May 27 16:51:17 2010
$OpenBSD: patch-doc_sample-xpdfrc,v 1.4 2011/10/01 19:46:35 kili Exp $
--- doc/sample-xpdfrc.orig Mon Aug 15 23:08:53 2011
+++ doc/sample-xpdfrc Thu Aug 18 21:10:22 2011
@@ -56,7 +56,7 @@
# Set the default PostScript file or command.
@ -10,9 +10,10 @@ $OpenBSD: patch-doc_sample-xpdfrc,v 1.3 2010/05/27 14:55:40 jasper Exp $
# Set the default PostScript paper size -- this can be letter, legal,
# A4, or A3. You can also specify a paper size as width and height
@@ -88,4 +88,4 @@
@@ -88,5 +88,5 @@
# Set the command used to run a web browser when a URL hyperlink is
# clicked.
-#urlCommand "netscape -remote 'openURL(%s)'"
-#launchCommand viewer-script
+#urlCommand "firefox -newtab -url 'openURL(%s)'"
#urlCommand "netscape -remote 'openURL(%s)'"

View File

@ -1,34 +0,0 @@
$OpenBSD: patch-splash_SplashXPathScanner_cc,v 1.3 2011/03/03 21:22:13 stsp Exp $
http://www.mail-archive.com/ports@openbsd.org/msg23488.html
--- splash/SplashXPathScanner.cc.orig Mon Aug 16 13:56:18 2010
+++ splash/SplashXPathScanner.cc Mon Aug 16 13:57:02 2010
@@ -397,7 +397,7 @@ void SplashXPathScanner::clipAALine(SplashBitmap *aaBu
for (; xx + 7 <= xx0; xx += 8) {
*p++ = 0x00;
}
- if (xx <= xx0) {
+ if (xx < xx0) {
*p &= 0xff >> (xx0 & 7);
}
}
@@ -406,6 +406,9 @@ void SplashXPathScanner::clipAALine(SplashBitmap *aaBu
}
}
xx0 = (*x1 + 1) * splashAASize;
+ if (xx0 > aaBuf->getWidth()) {
+ xx0 = aaBuf->getWidth();
+ }
// set [xx, xx0) to 0
if (xx < xx0) {
p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() + (xx >> 3);
@@ -420,7 +423,7 @@ void SplashXPathScanner::clipAALine(SplashBitmap *aaBu
for (; xx + 7 <= xx0; xx += 8) {
*p++ = 0x00;
}
- if (xx <= xx0) {
+ if (xx < xx0) {
*p &= 0xff >> (xx0 & 7);
}
}

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-splash_SplashXPath_cc,v 1.2 2010/12/04 10:45:21 miod Exp $
--- splash/SplashXPath.cc.orig Tue Feb 27 22:05:52 2007
+++ splash/SplashXPath.cc Fri Dec 3 21:16:36 2010
@@ -76,10 +76,26 @@ SplashXPath::SplashXPath(SplashPath *path, SplashCoord
$OpenBSD: patch-splash_SplashXPath_cc,v 1.3 2011/10/01 19:46:35 kili Exp $
--- splash/SplashXPath.cc.orig Mon Aug 15 23:08:53 2011
+++ splash/SplashXPath.cc Thu Aug 18 21:10:22 2011
@@ -73,10 +73,26 @@ SplashXPath::SplashXPath(SplashPath *path, SplashCoord
sizeof(SplashXPathAdjust));
for (i = 0; i < path->hintsLength; ++i) {
hint = &path->hints[i];

View File

@ -1,31 +0,0 @@
$OpenBSD: patch-xpdf_Catalog_cc,v 1.3 2007/03/30 04:09:42 ckuethe Exp $
--- xpdf/Catalog.cc.orig Tue Feb 27 22:05:52 2007
+++ xpdf/Catalog.cc Fri Mar 30 00:31:19 2007
@@ -65,6 +65,15 @@ Catalog::Catalog(XRef *xrefA) {
}
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 **)gmallocn(pagesSize, sizeof(Page *));
pageRefs = (Ref *)gmallocn(pagesSize, sizeof(Ref));
for (i = 0; i < pagesSize; ++i) {
@@ -217,6 +226,11 @@ int Catalog::readPageTree(Dict *pagesDict, PageAttrs *
}
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 **)greallocn(pages, pagesSize, sizeof(Page *));
pageRefs = (Ref *)greallocn(pageRefs, pagesSize, sizeof(Ref));
for (j = pagesSize - 32; j < pagesSize; ++j) {

View File

@ -1,10 +1,10 @@
$OpenBSD: patch-xpdf_GlobalParams_cc,v 1.1 2009/04/04 14:45:48 naddy Exp $
--- xpdf/GlobalParams.cc.orig Fri Apr 3 19:30:57 2009
+++ xpdf/GlobalParams.cc Fri Apr 3 19:31:18 2009
@@ -110,11 +110,7 @@ static char *displayFontDirs[] = {
$OpenBSD: patch-xpdf_GlobalParams_cc,v 1.2 2011/10/01 19:46:35 kili Exp $
--- xpdf/GlobalParams.cc.orig Mon Aug 15 23:08:53 2011
+++ xpdf/GlobalParams.cc Thu Aug 18 21:56:42 2011
@@ -110,11 +110,7 @@ static const char *displayFontDirs[] = {
};
#else
static char *displayFontDirs[] = {
static const char *displayFontDirs[] = {
- "/usr/share/ghostscript/fonts",
- "/usr/local/share/ghostscript/fonts",
- "/usr/share/fonts/default/Type1",

View File

@ -1,138 +0,0 @@
$OpenBSD: patch-xpdf_Object_h,v 1.1 2008/04/19 07:38:24 bernd Exp $
* CVE-2008-1693: Arbitrary code execution vulnerability in handling of
PDF embedded fonts.
From Debian.
--- xpdf/Object.h.orig Tue Feb 27 23:05:52 2007
+++ xpdf/Object.h Fri Apr 18 16:40:14 2008
@@ -68,17 +68,18 @@ enum ObjType {
//------------------------------------------------------------------------
#ifdef DEBUG_MEM
-#define initObj(t) ++numAlloc[type = t]
+#define initObj(t) zeroUnion(); ++numAlloc[type = t]
#else
-#define initObj(t) type = t
+#define initObj(t) zeroUnion(); type = t
#endif
class Object {
public:
-
+ // attempt to clear the anonymous union
+ void zeroUnion() { this->name = NULL; }
// Default constructor.
Object():
- type(objNone) {}
+ type(objNone) { zeroUnion(); }
// Initialize an object.
Object *initBool(GBool boolnA)
@@ -220,16 +221,16 @@ class Object { (private)
#include "Array.h"
inline int Object::arrayGetLength()
- { return array->getLength(); }
+ { if (type != objArray) return 0; return array->getLength(); }
inline void Object::arrayAdd(Object *elem)
- { array->add(elem); }
+ { if (type == objArray) array->add(elem); }
inline Object *Object::arrayGet(int i, Object *obj)
- { return array->get(i, obj); }
+ { if (type != objArray) return obj->initNull(); return array->get(i, obj); }
inline Object *Object::arrayGetNF(int i, Object *obj)
- { return array->getNF(i, obj); }
+ { if (type != objArray) return obj->initNull(); return array->getNF(i, obj); }
//------------------------------------------------------------------------
// Dict accessors.
@@ -238,31 +239,31 @@ inline Object *Object::arrayGetNF(int i, Object *obj)
#include "Dict.h"
inline int Object::dictGetLength()
- { return dict->getLength(); }
+ { if (type != objDict) return 0; return dict->getLength(); }
inline void Object::dictAdd(char *key, Object *val)
- { dict->add(key, val); }
+ { if (type == objDict) dict->add(key, val); }
inline GBool Object::dictIs(char *dictType)
- { return dict->is(dictType); }
+ { return (type == objDict) && dict->is(dictType); }
inline GBool Object::isDict(char *dictType)
- { return type == objDict && dictIs(dictType); }
+ { return (type == objDict) && dictIs(dictType); }
inline Object *Object::dictLookup(char *key, Object *obj)
- { return dict->lookup(key, obj); }
+ { if (type != objDict) return obj->initNull(); return dict->lookup(key, obj); }
inline Object *Object::dictLookupNF(char *key, Object *obj)
- { return dict->lookupNF(key, obj); }
+ { if (type != objDict) return obj->initNull(); return dict->lookupNF(key, obj); }
inline char *Object::dictGetKey(int i)
- { return dict->getKey(i); }
+ { if (type != objDict) return NULL; return dict->getKey(i); }
inline Object *Object::dictGetVal(int i, Object *obj)
- { return dict->getVal(i, obj); }
+ { if (type != objDict) return obj->initNull(); return dict->getVal(i, obj); }
inline Object *Object::dictGetValNF(int i, Object *obj)
- { return dict->getValNF(i, obj); }
+ { if (type != objDict) return obj->initNull(); return dict->getValNF(i, obj); }
//------------------------------------------------------------------------
// Stream accessors.
@@ -271,33 +272,33 @@ inline Object *Object::dictGetValNF(int i, Object *obj
#include "Stream.h"
inline GBool Object::streamIs(char *dictType)
- { return stream->getDict()->is(dictType); }
+ { return (type == objStream) && stream->getDict()->is(dictType); }
inline GBool Object::isStream(char *dictType)
- { return type == objStream && streamIs(dictType); }
+ { return (type == objStream) && streamIs(dictType); }
inline void Object::streamReset()
- { stream->reset(); }
+ { if (type == objStream) stream->reset(); }
inline void Object::streamClose()
- { stream->close(); }
+ { if (type == objStream) stream->close(); }
inline int Object::streamGetChar()
- { return stream->getChar(); }
+ { if (type != objStream) return EOF; return stream->getChar(); }
inline int Object::streamLookChar()
- { return stream->lookChar(); }
+ { if (type != objStream) return EOF; return stream->lookChar(); }
inline char *Object::streamGetLine(char *buf, int size)
- { return stream->getLine(buf, size); }
+ { if (type != objStream) return NULL; return stream->getLine(buf, size); }
inline Guint Object::streamGetPos()
- { return stream->getPos(); }
+ { if (type != objStream) return 0; return stream->getPos(); }
inline void Object::streamSetPos(Guint pos, int dir)
- { stream->setPos(pos, dir); }
+ { if (type == objStream) stream->setPos(pos, dir); }
inline Dict *Object::streamGetDict()
- { return stream->getDict(); }
+ { if (type != objStream) return NULL; return stream->getDict(); }
#endif

View File

@ -1,26 +0,0 @@
$OpenBSD: patch-xpdf_SplashOutputDev_cc,v 1.3 2011/03/03 21:22:13 stsp Exp $
Same as poppler commit 37077aa475d2dee81f87daa05297b201eeb99c87.
Fixes a heap overflow.
--- xpdf/SplashOutputDev.cc.orig Tue Feb 27 23:05:52 2007
+++ xpdf/SplashOutputDev.cc Mon Feb 14 00:37:00 2011
@@ -2475,14 +2475,14 @@ void SplashOutputDev::beginTransparencyGroup(GfxState
tx = (int)floor(xMin);
if (tx < 0) {
tx = 0;
- } else if (tx > bitmap->getWidth()) {
- tx = bitmap->getWidth();
+ } else if (tx >= bitmap->getWidth()) {
+ tx = bitmap->getWidth() - 1;
}
ty = (int)floor(yMin);
if (ty < 0) {
ty = 0;
- } else if (ty > bitmap->getHeight()) {
- ty = bitmap->getHeight();
+ } else if (ty >= bitmap->getHeight()) {
+ ty = bitmap->getHeight() - 1;
}
w = (int)ceil(xMax) - tx + 1;
if (tx + w > bitmap->getWidth()) {

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-xpdf_Stream_cc,v 1.5 2010/05/27 14:55:40 jasper Exp $
--- xpdf/Stream.cc.orig Thu May 27 12:16:31 2010
+++ xpdf/Stream.cc Thu May 27 12:16:32 2010
@@ -4516,7 +4516,7 @@ void ASCII85Encoder::reset() {
}
GBool ASCII85Encoder::fillBuf() {
- Gulong t;
+ Guint t;
char buf1[5];
int c0, c1, c2, c3;
int n, i;

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-xpdf_XRef_cc,v 1.5 2010/05/27 14:55:40 jasper Exp $
--- xpdf/XRef.cc.orig Thu May 27 12:16:32 2010
+++ xpdf/XRef.cc Thu May 27 12:16:32 2010
@@ -782,19 +782,19 @@ void XRef::setEncryption(int permFlagsA, GBool ownerPa
$OpenBSD: patch-xpdf_XRef_cc,v 1.6 2011/10/01 19:46:35 kili Exp $
--- xpdf/XRef.cc.orig Mon Aug 15 23:08:53 2011
+++ xpdf/XRef.cc Thu Aug 18 21:10:22 2011
@@ -806,19 +806,19 @@ void XRef::setEncryption(int permFlagsA, GBool ownerPa
}
GBool XRef::okToPrint(GBool ignoreOwnerPW) {
@ -24,4 +24,4 @@ $OpenBSD: patch-xpdf_XRef_cc,v 1.5 2010/05/27 14:55:40 jasper Exp $
+ return (1);
}
Object *XRef::fetch(int num, int gen, Object *obj) {
Object *XRef::fetch(int num, int gen, Object *obj, int recursion) {

View File

@ -1,9 +1,11 @@
@comment $OpenBSD: PLIST-utils,v 1.2 2009/04/17 20:55:46 kili Exp $
@comment $OpenBSD: PLIST-utils,v 1.3 2011/10/01 19:46:35 kili Exp $
@conflict xpdf-<=3.02pl2p0
@bin bin/pdfdetach
@bin bin/pdffonts
@bin bin/pdfimages
@bin bin/pdfinfo
@bin bin/pdftotext
@man man/man1/pdfdetach.1
@man man/man1/pdffonts.1
@man man/man1/pdfimages.1
@man man/man1/pdfinfo.1