Compare commits
100 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc5cf579cc | ||
|
|
dd61cc0a6f | ||
|
|
445565f0a7 | ||
|
|
102c70d26b | ||
|
|
6a51610411 | ||
|
|
a380722409 | ||
|
|
e8b04e115d | ||
|
|
99957267e9 | ||
|
|
2c55f22d9d | ||
|
|
1d3569c94e | ||
|
|
f6f060eee0 | ||
|
|
cb08af0fe9 | ||
|
|
bfd1224963 | ||
|
|
056c71eb88 | ||
|
|
1d7d4dd633 | ||
|
|
3329a5d8b4 | ||
|
|
ebc5729557 | ||
|
|
ea30f82cbd | ||
|
|
83b7840b44 | ||
|
|
ebf799c1ca | ||
|
|
fbb055f859 | ||
|
|
4405d18447 | ||
|
|
cec4559d3d | ||
|
|
28cb85d019 | ||
|
|
09a58bb043 | ||
|
|
fa76938a06 | ||
|
|
848c5d212b | ||
|
|
763cd44c6a | ||
|
8ff5952173 |
|||
|
|
2f849018b1 | ||
|
|
8b47d1e87c | ||
|
|
542eb321ea | ||
|
|
8519e3004d | ||
|
|
feedce6864 | ||
|
|
eb798fdbda | ||
|
|
d7f1600cea | ||
|
|
7334e2956e | ||
|
|
4ad1913390 | ||
|
|
4d4b8daed4 | ||
| add024a570 | |||
|
4f5907b5b3 |
|||
|
|
b5d52e96b1 | ||
|
|
d5f166a4b6 | ||
| a75fdf9444 | |||
|
|
1c211d50f2 | ||
|
|
53d1c3b612 | ||
|
|
85ecd3a080 | ||
|
|
41efb503bf | ||
|
|
0cd5a4e128 | ||
|
|
1c4d18e4ec | ||
|
|
752fce5e62 | ||
|
|
1b2c6bf04f | ||
|
|
0f746fdeab | ||
|
|
98434c99a1 | ||
|
|
736bdc29b9 | ||
|
|
7bb177660a | ||
|
|
30a93c5c6b | ||
|
|
efaabc0150 | ||
|
|
8f7ab5c178 | ||
|
|
f8865fac84 | ||
|
|
f0a27338ae | ||
|
|
e8ba2a976c | ||
|
|
7a77c71ab3 | ||
| 00a8309acb | |||
|
|
29000395f4 | ||
|
|
fd37020261 | ||
|
|
c11e39a194 | ||
|
|
99621ebe33 | ||
|
|
ef59550e71 | ||
|
|
d57d96bb16 | ||
|
|
1cf187db7a | ||
|
|
e804465562 | ||
|
|
f1529f5842 | ||
|
|
84fe4c7860 | ||
|
|
daae1cf156 | ||
|
|
6328fa1bbc | ||
|
|
fe0826c4b7 | ||
|
|
24a30ac873 | ||
|
|
b188a15c13 | ||
|
|
b3eacf5fae | ||
|
|
f02e87eaef | ||
|
|
eb4b7782cf | ||
|
|
5b628c3fdb | ||
|
|
9542866832 | ||
|
|
f40d143aa3 | ||
|
|
05638cac97 | ||
|
|
355383cf07 | ||
|
|
7afecabb07 | ||
|
|
8c6cc6ecc2 | ||
|
|
c125c60c61 | ||
|
|
0a3c14c197 | ||
|
|
60735825ee | ||
|
|
bed41332f7 | ||
|
|
defe5a081d | ||
|
|
13020db41b | ||
|
|
0d8a4e6a9c | ||
|
|
d21fd7e7b2 | ||
|
|
721794f391 | ||
|
|
66dd08d39f | ||
|
|
e2062dc799 |
60 changed files with 6310 additions and 21 deletions
46
.gitignore
vendored
Normal file
46
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
xpdf-3.01-novms.tar.gz
|
||||
xpdf-chinese-simplified-2004-jul-27-NOCMAP.tar.gz
|
||||
xpdf-chinese-traditional-2004-jul-27-NOCMAP.tar.gz
|
||||
xpdf-cyrillic-2003-jun-28.tar.gz
|
||||
xpdf-japanese-2004-jul-27-NOCMAP.tar.gz
|
||||
xpdf-korean-2005-jul-07-NOCMAP.tar.gz
|
||||
xpdf-thai-2002-jan-16.tar.gz
|
||||
xpdf-arabic-2003-feb-16.tar.gz
|
||||
xpdf-greek-2003-jun-28.tar.gz
|
||||
xpdf-hebrew-2003-feb-16.tar.gz
|
||||
xpdf-latin2-2002-oct-22.tar.gz
|
||||
xpdf-turkish-2002-apr-10.tar.gz
|
||||
xpdf-3.02-novms.tar.gz
|
||||
/xpdf-3.03-novms.tar.gz
|
||||
/xpdf-3.04.tar.gz
|
||||
/xpdf-arabic-2011-aug-15.tar.gz
|
||||
/xpdf-chinese-simplified-2011-sep-02-NOCMAP.tar.gz
|
||||
/xpdf-chinese-traditional-2011-sep-02-NOCMAP.tar.gz
|
||||
/xpdf-cyrillic-2011-aug-15.tar.gz
|
||||
/xpdf-greek-2011-aug-15.tar.gz
|
||||
/xpdf-hebrew-2011-aug-15.tar.gz
|
||||
/xpdf-japanese-2011-sep-02-NOCMAP.tar.gz
|
||||
/xpdf-korean-2011-sep-02-NOCMAP.tar.gz
|
||||
/xpdf-latin2-2011-aug-15.tar.gz
|
||||
/xpdf-thai-2011-aug-15.tar.gz
|
||||
/xpdf-turkish-2011-aug-15.tar.gz
|
||||
/xpdf-4.00.tar.gz
|
||||
/xpdf-chinese-simplified-2017-jul-25-NOCMAP.tar.gz
|
||||
/xpdf-chinese-traditional-2017-jul-25-NOCMAP.tar.gz
|
||||
/xpdf-japanese-2017-jul-25-NOCMAP.tar.gz
|
||||
/xpdf-korean-2017-jul-25-NOCMAP.tar.gz
|
||||
/xpdf-4.01.tar.gz
|
||||
/xpdf-4.02.tar.gz
|
||||
/xpdf-chinese-simplified-2020-dec-22-NOCMAP.tar.gz
|
||||
/xpdf-chinese-traditional-2020-dec-22-NOCMAP.tar.gz
|
||||
/xpdf-japanese-2020-dec-22-NOCMAP.tar.gz
|
||||
/xpdf-korean-2020-dec-22-NOCMAP.tar.gz
|
||||
/xpdf-4.03.tar.gz
|
||||
/xpdf-4.04.tar.gz
|
||||
/xpdf-4.05.tar.gz
|
||||
/xpdf-chinese-simplified-2023-dec-05-NOCMAP.tar.gz
|
||||
/xpdf-korean-2023-dec-05-NOCMAP.tar.gz
|
||||
/xpdf-4.05.tar.gz.sig
|
||||
/xpdf-thai.tar.gz
|
||||
/xpdf-4.06.tar.gz
|
||||
/xpdf-4.06.tar.gz.sig
|
||||
172
02_permissions.dpatch
Normal file
172
02_permissions.dpatch
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
diff -up xpdf-3.04/xpdf/PDFCore.cc.permissions xpdf-3.04/xpdf/PDFCore.cc
|
||||
--- xpdf-3.04/xpdf/PDFCore.cc.permissions 2014-05-28 14:50:50.000000000 -0400
|
||||
+++ xpdf-3.04/xpdf/PDFCore.cc 2014-05-29 15:42:47.290665898 -0400
|
||||
@@ -4,6 +4,8 @@
|
||||
//
|
||||
// Copyright 2004-2013 Glyph & Cog, LLC
|
||||
//
|
||||
+// Modified for Debian by Hamish Moffatt, 18 August 2005.
|
||||
+//
|
||||
//========================================================================
|
||||
|
||||
#include <aconf.h>
|
||||
@@ -1677,9 +1679,11 @@ GString *PDFCore::extractText(int pg, do
|
||||
int x0, y0, x1, y1, t;
|
||||
GString *s;
|
||||
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
if (!doc->okToCopy()) {
|
||||
return NULL;
|
||||
}
|
||||
+#endif
|
||||
if ((page = findPage(pg))) {
|
||||
cvtUserToDev(pg, xMin, yMin, &x0, &y0);
|
||||
cvtUserToDev(pg, xMax, yMax, &x1, &y1);
|
||||
diff -up xpdf-3.04/xpdf/pdfimages.cc.permissions xpdf-3.04/xpdf/pdfimages.cc
|
||||
--- xpdf-3.04/xpdf/pdfimages.cc.permissions 2014-05-28 14:50:50.000000000 -0400
|
||||
+++ xpdf-3.04/xpdf/pdfimages.cc 2014-05-29 15:40:57.814449375 -0400
|
||||
@@ -4,6 +4,8 @@
|
||||
//
|
||||
// Copyright 1998-2003 Glyph & Cog, LLC
|
||||
//
|
||||
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
|
||||
+//
|
||||
//========================================================================
|
||||
|
||||
#include <aconf.h>
|
||||
@@ -119,12 +121,14 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
// check for copy permission
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
if (!doc->okToCopy()) {
|
||||
error(errNotAllowed, -1,
|
||||
"Copying of images from this document is not allowed.");
|
||||
exitCode = 3;
|
||||
goto err1;
|
||||
}
|
||||
+#endif
|
||||
|
||||
// get page range
|
||||
if (firstPage < 1)
|
||||
diff -up xpdf-3.04/xpdf/pdftops.cc.permissions xpdf-3.04/xpdf/pdftops.cc
|
||||
--- xpdf-3.04/xpdf/pdftops.cc.permissions 2014-05-28 14:50:50.000000000 -0400
|
||||
+++ xpdf-3.04/xpdf/pdftops.cc 2014-05-29 15:40:57.815449368 -0400
|
||||
@@ -4,6 +4,8 @@
|
||||
//
|
||||
// Copyright 1996-2003 Glyph & Cog, LLC
|
||||
//
|
||||
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
|
||||
+//
|
||||
//========================================================================
|
||||
|
||||
#include <aconf.h>
|
||||
@@ -300,12 +302,14 @@ int main(int argc, char *argv[]) {
|
||||
goto err1;
|
||||
}
|
||||
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
// check for print permission
|
||||
if (!doc->okToPrint()) {
|
||||
error(errNotAllowed, -1, "Printing this document is not allowed.");
|
||||
exitCode = 3;
|
||||
goto err1;
|
||||
}
|
||||
+#endif
|
||||
|
||||
// construct PostScript file name
|
||||
if (argc == 3) {
|
||||
diff -up xpdf-3.04/xpdf/pdftotext.cc.permissions xpdf-3.04/xpdf/pdftotext.cc
|
||||
--- xpdf-3.04/xpdf/pdftotext.cc.permissions 2014-05-28 14:50:50.000000000 -0400
|
||||
+++ xpdf-3.04/xpdf/pdftotext.cc 2014-05-29 15:43:37.923303455 -0400
|
||||
@@ -4,6 +4,8 @@
|
||||
//
|
||||
// Copyright 1997-2013 Glyph & Cog, LLC
|
||||
//
|
||||
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
|
||||
+//
|
||||
//========================================================================
|
||||
|
||||
#include <aconf.h>
|
||||
@@ -188,6 +190,7 @@ int main(int argc, char *argv[]) {
|
||||
goto err2;
|
||||
}
|
||||
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
// check for copy permission
|
||||
if (!doc->okToCopy()) {
|
||||
error(errNotAllowed, -1,
|
||||
@@ -195,6 +198,7 @@ int main(int argc, char *argv[]) {
|
||||
exitCode = 3;
|
||||
goto err2;
|
||||
}
|
||||
+#endif
|
||||
|
||||
// construct text file name
|
||||
if (argc == 3) {
|
||||
diff -up xpdf-3.04/xpdf/XPDFCore.cc.permissions xpdf-3.04/xpdf/XPDFCore.cc
|
||||
--- xpdf-3.04/xpdf/XPDFCore.cc.permissions 2014-05-29 15:40:57.777449640 -0400
|
||||
+++ xpdf-3.04/xpdf/XPDFCore.cc 2014-05-29 15:40:57.819449339 -0400
|
||||
@@ -4,6 +4,8 @@
|
||||
//
|
||||
// Copyright 2002-2003 Glyph & Cog, LLC
|
||||
//
|
||||
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
|
||||
+//
|
||||
//========================================================================
|
||||
|
||||
#include <aconf.h>
|
||||
@@ -384,12 +386,16 @@ void XPDFCore::endSelection(int wx, int
|
||||
#ifndef NO_TEXT_SELECT
|
||||
if (selectULX != selectLRX &&
|
||||
selectULY != selectLRY) {
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
if (doc->okToCopy()) {
|
||||
copySelection();
|
||||
} else {
|
||||
error(errNotAllowed, -1,
|
||||
"Copying of text from this document is not allowed.");
|
||||
}
|
||||
+#else
|
||||
+ copySelection();
|
||||
+#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -408,9 +414,11 @@ void XPDFCore::copySelection() {
|
||||
int pg;
|
||||
double ulx, uly, lrx, lry;
|
||||
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
if (!doc->okToCopy()) {
|
||||
return;
|
||||
}
|
||||
+#endif
|
||||
if (getSelection(&pg, &ulx, &uly, &lrx, &lry)) {
|
||||
//~ for multithreading: need a mutex here
|
||||
if (currentSelection) {
|
||||
diff -up xpdf-3.04/xpdf/XPDFViewer.cc.permissions xpdf-3.04/xpdf/XPDFViewer.cc
|
||||
--- xpdf-3.04/xpdf/XPDFViewer.cc.permissions 2014-05-29 15:40:57.808449418 -0400
|
||||
+++ xpdf-3.04/xpdf/XPDFViewer.cc 2014-05-29 15:40:57.821449325 -0400
|
||||
@@ -4,6 +4,8 @@
|
||||
//
|
||||
// Copyright 2002-2003 Glyph & Cog, LLC
|
||||
//
|
||||
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
|
||||
+//
|
||||
//========================================================================
|
||||
|
||||
#include <aconf.h>
|
||||
@@ -3503,10 +3505,12 @@ void XPDFViewer::printPrintCbk(Widget wi
|
||||
PSOutputDev *psOut;
|
||||
|
||||
doc = viewer->core->getDoc();
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
if (!doc->okToPrint()) {
|
||||
error(errNotAllowed, -1, "Printing this document is not allowed.");
|
||||
return;
|
||||
}
|
||||
+#endif
|
||||
|
||||
viewer->core->setBusyCursor(gTrue);
|
||||
|
||||
33
10_add_accelerators.dpatch
Normal file
33
10_add_accelerators.dpatch
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## 10_add_accelerators.dpatch by <hamish@noddy.cloud.net.au>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Add keyboard accelerators for rotate (#385962)
|
||||
|
||||
@DPATCH@
|
||||
diff -urNad xpdf-3.02~/xpdf/XPDFViewer.cc xpdf-3.02/xpdf/XPDFViewer.cc
|
||||
--- xpdf-3.02~/xpdf/XPDFViewer.cc 2007-04-25 01:40:50.000000000 +1000
|
||||
+++ xpdf-3.02/xpdf/XPDFViewer.cc 2007-04-25 01:42:13.000000000 +1000
|
||||
@@ -1958,16 +1958,22 @@
|
||||
n = 0;
|
||||
s = XmStringCreateLocalized("Rotate counterclockwise");
|
||||
XtSetArg(args[n], XmNlabelString, s); ++n;
|
||||
+ s2 = XmStringCreateLocalized("[");
|
||||
+ XtSetArg(args[n], XmNacceleratorText, s2); ++n;
|
||||
btn = XmCreatePushButton(popupMenu, "rotateCCW", args, n);
|
||||
XmStringFree(s);
|
||||
+ XmStringFree(s2);
|
||||
XtManageChild(btn);
|
||||
XtAddCallback(btn, XmNactivateCallback,
|
||||
&rotateCCWCbk, (XtPointer)this);
|
||||
n = 0;
|
||||
s = XmStringCreateLocalized("Rotate clockwise");
|
||||
XtSetArg(args[n], XmNlabelString, s); ++n;
|
||||
+ s2 = XmStringCreateLocalized("]");
|
||||
+ XtSetArg(args[n], XmNacceleratorText, s2); ++n;
|
||||
btn = XmCreatePushButton(popupMenu, "rotateCW", args, n);
|
||||
XmStringFree(s);
|
||||
+ XmStringFree(s2);
|
||||
XtManageChild(btn);
|
||||
XtAddCallback(btn, XmNactivateCallback,
|
||||
&rotateCWCbk, (XtPointer)this);
|
||||
21
Makefile
21
Makefile
|
|
@ -1,21 +0,0 @@
|
|||
# Makefile for source rpm: xpdf
|
||||
# $Id$
|
||||
NAME := xpdf
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
define find-makefile-common
|
||||
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
||||
|
||||
ifeq ($(MAKEFILE_COMMON),)
|
||||
# attept a checkout
|
||||
define checkout-makefile-common
|
||||
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
|
||||
endif
|
||||
|
||||
include $(MAKEFILE_COMMON)
|
||||
42
fix-437725.dpatch
Normal file
42
fix-437725.dpatch
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## fix-437725.dpatch from Arno Renevier <arenevier@fdn.fr>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Fix segmentation fault when pressing Ctrl-W in full screen mode
|
||||
|
||||
@DPATCH@
|
||||
--- a/xpdf/XPDFViewer.cc 2007-08-13 22:41:36.000000000 +0200
|
||||
+++ b/xpdf/XPDFViewer.cc 2007-08-13 23:01:07.000000000 +0200
|
||||
@@ -400,18 +400,21 @@ void XPDFViewer::clear() {
|
||||
title = app->getTitle() ? app->getTitle()->getCString()
|
||||
: (char *)xpdfAppName;
|
||||
XtVaSetValues(win, XmNtitle, title, XmNiconName, title, NULL);
|
||||
- s = XmStringCreateLocalized("");
|
||||
- XtVaSetValues(pageNumText, XmNlabelString, s, NULL);
|
||||
- XmStringFree(s);
|
||||
- s = XmStringCreateLocalized(" of 0");
|
||||
- XtVaSetValues(pageCountLabel, XmNlabelString, s, NULL);
|
||||
- XmStringFree(s);
|
||||
|
||||
- // disable buttons
|
||||
- XtVaSetValues(prevTenPageBtn, XmNsensitive, False, NULL);
|
||||
- XtVaSetValues(prevPageBtn, XmNsensitive, False, NULL);
|
||||
- XtVaSetValues(nextTenPageBtn, XmNsensitive, False, NULL);
|
||||
- XtVaSetValues(nextPageBtn, XmNsensitive, False, NULL);
|
||||
+ if (toolBar != None) {
|
||||
+ s = XmStringCreateLocalized("");
|
||||
+ XtVaSetValues(pageNumText, XmNlabelString, s, NULL);
|
||||
+ XmStringFree(s);
|
||||
+ s = XmStringCreateLocalized(" of 0");
|
||||
+ XtVaSetValues(pageCountLabel, XmNlabelString, s, NULL);
|
||||
+ XmStringFree(s);
|
||||
+
|
||||
+ // disable buttons
|
||||
+ XtVaSetValues(prevTenPageBtn, XmNsensitive, False, NULL);
|
||||
+ XtVaSetValues(prevPageBtn, XmNsensitive, False, NULL);
|
||||
+ XtVaSetValues(nextTenPageBtn, XmNsensitive, False, NULL);
|
||||
+ XtVaSetValues(nextPageBtn, XmNsensitive, False, NULL);
|
||||
+ }
|
||||
|
||||
// remove the old outline
|
||||
#ifndef DISABLE_OUTLINE
|
||||
18
fix-444648.dpatch
Normal file
18
fix-444648.dpatch
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## fix-444648.dpatch by Bernhard R. Link <brlink@debian.org>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Do proper PS stream encoding on 64 bit architectures
|
||||
|
||||
@DPATCH@
|
||||
--- xpdf-3.02/xpdf/Stream.cc.BAD 2008-12-10 12:16:16.000000000 -0500
|
||||
+++ xpdf-3.02/xpdf/Stream.cc 2008-12-10 12:16:21.000000000 -0500
|
||||
@@ -4514,7 +4514,7 @@ void ASCII85Encoder::reset() {
|
||||
GBool ASCII85Encoder::fillBuf() {
|
||||
Guint t;
|
||||
char buf1[5];
|
||||
- int c0, c1, c2, c3;
|
||||
+ unsigned int c0, c1, c2, c3;
|
||||
int n, i;
|
||||
|
||||
if (eof) {
|
||||
28
fix-462544.dpatch
Normal file
28
fix-462544.dpatch
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## fix-462544.dpatch from Jiri Palecek <jpalecek@web.de>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Fix segmentation fault in image handling
|
||||
|
||||
@DPATCH@
|
||||
--- xpdf-3.02/xpdf/SplashOutputDev.cc 2007-02-27 23:05:52.000000000 +0100
|
||||
+++ xpdf-3.02.new/xpdf/SplashOutputDev.cc 2008-02-17 17:28:46.000000000 +0100
|
||||
@@ -2475,14 +2461,14 @@
|
||||
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()) {
|
||||
20
fix-479467.dpatch
Normal file
20
fix-479467.dpatch
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## fix-479467.dpatch from Stephan Beyer <s-beyer@gmx.net>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Fix segmentation fault when pressing g in full screen mode
|
||||
|
||||
@DPATCH@
|
||||
diff -ruN xpdf-3.02.old/xpdf/XPDFViewer.cc xpdf-3.02.fix/xpdf/XPDFViewer.cc
|
||||
--- xpdf-3.02.old/xpdf/XPDFViewer.cc 2007-02-27 23:05:52.000000000 +0100
|
||||
+++ xpdf-3.02.fix/xpdf/XPDFViewer.cc 2008-05-04 21:29:34.000000000 +0200
|
||||
@@ -834,6 +834,9 @@
|
||||
|
||||
void XPDFViewer::cmdFocusToPageNum(GString *args[], int nArgs,
|
||||
XEvent *event) {
|
||||
+ if (core->getFullScreen()) {
|
||||
+ return;
|
||||
+ }
|
||||
XmTextFieldSetSelection(pageNumText, 0,
|
||||
strlen(XmTextFieldGetString(pageNumText)),
|
||||
XtLastTimestampProcessed(display));
|
||||
62
gpg-key.txt
Normal file
62
gpg-key.txt
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQINBFhmydMBEACjLpJGlKBzA5WFopW+qYGpwPvWLH/Dd3sEdHffxMxEbas06I7Y
|
||||
KE30JIlFfL4oZHaytDNSZraA7DpkoPQM0EOpFeK1sgxJUKH+CPeRxhdjAkH6SxU1
|
||||
dOLWL4CQPVRYWBcuxwW1asxHTJZtaeGnTmstNuhuzwjj4BlTRmA6MbSh/DBCN104
|
||||
6idBf+KCfm+SLYK2KxeYDEyYV/i6p1+TRs+PVmDXKyBanxiP3StZC+BCOLfXzg9S
|
||||
+LFLFvbKRdq2Ofn5nLULmk7+1VT44eXLQgw0pgBJ5OlFCaL6S5ZUbtyDzGxK/ECL
|
||||
4ozCwLDx93hrVtofPJpdqBfgAQpiGy0Rd9925EchkW7RTwkxSKa1YT8GI5fKatTj
|
||||
BA1p5+YuQ+ml2UaPmHxpc/AizsRI9OBD7NmoxW2RNt7CBLhRb0JscDtXpm7jvTnO
|
||||
bDPUOmH9klwKdkj+WACQaNrbD2BIN715JtTsRbgxpqQ3nHDug6xCVbZdvoln91+P
|
||||
TCE8zJ3wLWXCXrXLVV0ZQhVUNGk/u3gLOxG8HmYCfwSZQhgxViwupTHkRU41BoLe
|
||||
Iyja9GjuZw0CUPwABS7/jq0Td166ziFfzoBIxIsK1ikgW8kDhsfKXPOFo4qGAdjg
|
||||
yURKBk70GXR/U7B97ZJ3StWTcm3Y0B5NiyRaxMIYs5weVg2PE0X9ch0y0QARAQAB
|
||||
tBwtWHBkZi0gPHhwZGZAeHBkZnJlYWRlci5jb20+iQI3BBMBAgAhAhsDAh4BAheA
|
||||
BQJYZstXBQsJCAcDBRUKCQgLBRYCAwEAAAoJEPSCX1OXJxNCLlUQAJqSTuBNgzsF
|
||||
yvwccsbSbCXh79rr3xoYnlU4w7/sYEdAqUuXATUa9mxekecyauVWhpsm+LSUrquc
|
||||
TCYZOtcy8lqdQhNZtfZa9K9CJLG5fAQrflDI0ABBUb3rGkv4wegVKDoD8Xj9vdPd
|
||||
ThDsy7eV7tinfUAdoO9zguuGgQ7R1eYgMSwjIdK8lwcVwLorc3/RlrcV8fgnEW6m
|
||||
pZDcnoH2ogbTZMN7CrCa8IE/ggKe8iOV2fVgnL+r0Bj3dSlP9ZXBpuw9u9tO6s0H
|
||||
zI4NdbMoUzP5+H1FzeGJVt7NZJuGGmZz/FEVLWXwUElP1OGlAGNqsqXlChMEFDqo
|
||||
+rXcKUJyQebr6vOtWcVyyITzEkshFET/JCi+aIID9vggDcL6RmFlA8JtAbPP90TI
|
||||
tq94PXmFx+jQLrJ2vLhZGchlLn8wVZ/DeZP/y9rDZXUlhlllgLiN1CSD5iCMuL+T
|
||||
qHftFFF+C7MPIHBMGRjjOwmJtAWR/wwe4mrkuyKt4gF6nKQBqOsVuNt2RWAA27Ac
|
||||
CctX8ce8KuDfW4XJlr6BwIrzffa47nyBIZstGCptKMxGywvu+ufLgGz2kv78wO9X
|
||||
bg2kgFIbI1C7YI1KUUuoACFjDGCVbdnzSUS7pWOebXNQ+cvqy82ExMvv/ieD6Rfg
|
||||
jKZH7lj7cmA9YBqnUmXS/57GSQu94i18iQIcBBABCgAGBQJYZsySAAoJEBCYN7iF
|
||||
KMl4kI8P/3d0YYUVrA5f7C3FEuW11sedr3o/DDv/QA8Aj68gb/efG0nCzi5cIuL0
|
||||
7MM7St0VI9UypGl0kExforcu80Zk0x95RCYRb46e2lTNIXpNL3CstXquatDrZ66X
|
||||
bdOHOV5I/PQ8PJhAyy8pPdlShIz4dfcPT+JXoCX85gtdp/0vg84kaiuQNpbm3wjk
|
||||
/BJNPJovUea7K5c0KLwrcXy1vyPdW4I3vQvK9JWxewbZ/nK5Fu45yhK1lMvIqO2x
|
||||
fGSpYizVFLhuq85+qm2E4IMnlTC48ygWd3t5N+dYSU1XRjqFRzw4+dPgBqBomajW
|
||||
0yXgUUDnYS7a715ZhDblwt8sC5HgRIjpr7Sj4zgCW+MjrnyZBM22zu5CmUAfdkBx
|
||||
VH3igHF7IWDpXonC/nrbFauo4cnW4y4Sv+oH56UheQwtUykRgj9yZXL1cNin6ZXb
|
||||
vRPV7Kbza4d0y6m+kBFWXh0Befqijw4uXbXQIG1SSurKlQihV+cRBJSiMklDMVQ4
|
||||
hkFKra1Pgom9ZmOixmPnJclKObeVwF7CWIVsdIyiNEwkDx0MjYqlvRvnCIdmJ1ej
|
||||
5/d+D3uWpjI2UFkNI7KIdGARXE53dPh3frIwzwRWLh8InoK461z47ukQU3q3/eZI
|
||||
Ar9LP/6g6AlsLVjsqHTs9oMdN/YItQxQb/1bZxIrG6wuk9imlnd4uQINBFhmydMB
|
||||
EACc6p09brIdWJmpGOz1LxIEOOiL8hQo1oOlGeigFgLZ99TsJHV9rJ+oUuRsr9Kd
|
||||
MTf0g13NEHOyp0/8KJXSN4R/zVDykBdvVblNIDYUEyOVvvueVjcMKTOOt6iV2naC
|
||||
pkyRTDctgt04VeTau8r6hgYxWT5f2XtsKHNu+kv6RPc7GbSgubiaTujRcl+iOCXi
|
||||
tNKUNFQ83G1rvYOEaiaoGXQ4dRHW7u+St4b0bJLgO+FUovVxd714RWNZ4UleDVV8
|
||||
VzGkcU3j7B4u39GiVNgxGnmnfTA7AJ5YWLqRhfuf/uyEgs1Iety4/eZdwPtg2w0U
|
||||
JTo/T+mbRBS0cDXBm4+kYMeKHpN1yMmeaYA3bv/miz/ik1/HKhlned4t47TlhUFu
|
||||
jxkmvfTI6XtzRZ98607ICOAH7PKAv1YrQsxohSrVcRZK+4jofT4vMgcbFTFuRYMP
|
||||
EemYMAphPyHBPJG+YAVIM/S9MaWYYC/LR7jtkt/MosI3SLzw09rf9e1mCajaYb6q
|
||||
yCopfK84nao2gmFFE9vt7hOcmhGZ8WAlsL9rVW8nmBk3OZYIRWIxbB+iA0/et6E0
|
||||
1K4iQbeEu6pRDCA+Lkw2NWAOBVXgBKuvUDzXYV86wI+7m94IXuQQ2BXugstuVMWw
|
||||
AKqgbT+CTOc6Th1rzBI4bjJfUxm6eOsU/t3+2Gq1s8joxwARAQABiQIfBBgBAgAJ
|
||||
BQJYZsnTAhsMAAoJEPSCX1OXJxNC7ysP+wfpmD5kboss1cNbEfdbFZvwsh982Y3H
|
||||
FN4w0dvquJxJhSnfx64tnhjZCAPmVkUutfde3/fGylQ3v9j3kg/q0EJ56Df3QcFb
|
||||
QcJpyM+rfVI3eKuO/zH1TjMlhzKI/TgES1xCOCqTlmMPFY+akWAVFKk6/fVz6rhg
|
||||
tIJyj/7+lV7xWDNJZmyAuBPiNW6YPH92u4gDR3GPFQSClEetlD4heAOISph9C2fN
|
||||
QPmivr8jYMhbWr2kGvsfY2wgBOzeijmUYRyfoXxjHOo9tkMYik1DCdsXfxevbAa3
|
||||
Q6ybcwmx6QvjOlH4TLlv43JHettMudVGuiCBBTDtbUouX9+2vXRuCHeEzb7iusLC
|
||||
ZINce8kxs83EiTfa1J00eJ4vTK6z5yZN+29DC/00SdmUX0Agnoo5Msxi10o6wJLz
|
||||
Dsg81UFjL3rE0UQ2TBch6hAiUlvJF95E0fylWpL4rxuEeuxh4U/82wAR+1g4Fj3K
|
||||
YNQXjW8sko60VnCMTEBeJ7s09U/GIygb9Ixcoz1OhgIbpXox/0lqVpI9V0ekddc+
|
||||
n1LhYrjWIcBzK2t1t/0isI5mkkV4gztpRcVWoTEbynN37He3HFL90gN0zmGBE2oY
|
||||
gTfCw3gRA3iUJ4varAX9DF0baTQzh9wVdnYk9RIlZovkzmn45z5ogZ7B1xpHtuhl
|
||||
PYZrVz++lRb0
|
||||
=6AFt
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
13
sources
13
sources
|
|
@ -0,0 +1,13 @@
|
|||
SHA512 (xpdf-arabic-2011-aug-15.tar.gz) = 1ddaee045c0c3576bda0ebf065021e66e1ac6673d6872aff8e8afb3bae33dd927d920d89761553bade040d20e4b60eb286131bdb2f2d75ec1e833b9a9ce58d3e
|
||||
SHA512 (xpdf-cyrillic-2011-aug-15.tar.gz) = ab1197c90f8cd3d8664ebbdc7ecefdfb8ec12e24da2f7616cad1d5bc9c7fd172c48db6a18d76172de8342377acc8e1dcd78bcf0fb1ef9f05cf94729e90586827
|
||||
SHA512 (xpdf-greek-2011-aug-15.tar.gz) = 2e0e281e09e1abc2f0e40b6787703538d52cb62edcd4c4156698700a5f908afee290c62ad9a6ff4ea74bc42e0a8fe9a7765a212efbc223512d4bb442448ea52f
|
||||
SHA512 (xpdf-hebrew-2011-aug-15.tar.gz) = 0ebe652f8633151d13ef2403bd293682b511ab86c1391ce187f1fc0274f33bd9c7e6ec682c8f79ac4fd27c74ab81ad2ae334a75f26001092521cff9a73cd0b8a
|
||||
SHA512 (xpdf-latin2-2011-aug-15.tar.gz) = 5fe0b60bfac7f0f4a26e3e7216de5043f6b94446f464c984b7c25431ec01a5912952c0dc66bb2c7159c9f63e4805689c6cfc761086aad9e59f1f21d0cddb5d15
|
||||
SHA512 (xpdf-turkish-2011-aug-15.tar.gz) = a73e90bce8f2a12154b06ef29333a45d96258c0d653d5cb15afd2e5ad9e79a9b617e5f8ebeb20bde545684d50f3bc1349800c99f70c863bdd502c24c266b4fb1
|
||||
SHA512 (xpdf-chinese-traditional-2020-dec-22-NOCMAP.tar.gz) = ff25947dbf09b51f9c97aff898b8d33441af230d25c827380f1f5dd4144b5c3d14fc0d1e1ed42e039ff706568a490925f1cafc94ff5f70ae7879827c82dfbc85
|
||||
SHA512 (xpdf-japanese-2020-dec-22-NOCMAP.tar.gz) = aff90d0c8f26e1dffd2b178c5ee676cfa520086d28dd56af65ef3fcd016c2770361edeb35974f45328cd62d5cd7dff0ac719e38ee2594bef07e062869289a647
|
||||
SHA512 (xpdf-chinese-simplified-2023-dec-05-NOCMAP.tar.gz) = 292a819cca4d6095b6835b30241abbbbb07354adc839c9a49b90f2dd9deb1fc7d8727a9bade3cab88da8e903e00199ecf8672727ae7310cc15e1ad8c282d218b
|
||||
SHA512 (xpdf-korean-2023-dec-05-NOCMAP.tar.gz) = 3ca81eaee279122a8054fc26f16d85c668d0571a1b249a410346196c2b61081bcdfec61c140a7334a921d80738e908b507ac47a301f3aae37b3050c8e8b77f29
|
||||
SHA512 (xpdf-thai.tar.gz) = c738ef97c57630feb4d1bae3df36ba02118f73e770caeef4bd3256740b9aadb94ec07b993a01a6abc9ba711d6dc2900f90eb7e1c7bbbf157f07160be1743d3f1
|
||||
SHA512 (xpdf-4.06.tar.gz) = ace2d2c006411ef40f3510fe34809e6ed5fd4a2367ac11a75e9d4795aa5054e72f12e307165d11a25b12609d33b279b9b99d9c072442e98308a77ad022bc8355
|
||||
SHA512 (xpdf-4.06.tar.gz.sig) = 2df5d491a2126c9f879896c623193cfb6e7b38da53a1eaac4060b77569d84b2d28a12e3a1285d31bb9a422f774f3d70238d47bfec388db1222fc041627da1ec7
|
||||
50
xpdf-2.02-ext.patch
Normal file
50
xpdf-2.02-ext.patch
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
--- xpdf-2.02/goo/gfile.cc.orig 2003-03-31 16:45:50.000000000 +0200
|
||||
+++ xpdf-2.02/goo/gfile.cc 2003-03-31 17:09:19.000000000 +0200
|
||||
@@ -486,32 +486,14 @@
|
||||
char *s;
|
||||
int fd;
|
||||
|
||||
- if (ext) {
|
||||
-#if HAVE_MKSTEMPS
|
||||
- if ((s = getenv("TMPDIR"))) {
|
||||
- *name = new GString(s);
|
||||
- } else {
|
||||
- *name = new GString("/tmp");
|
||||
- }
|
||||
- (*name)->append("/XXXXXX")->append(ext);
|
||||
- fd = mkstemps((*name)->getCString(), strlen(ext));
|
||||
-#else
|
||||
- if (!(s = tmpnam(NULL))) {
|
||||
- return gFalse;
|
||||
- }
|
||||
+#if HAVE_MKSTEMP
|
||||
+ if ((s = getenv("TMPDIR"))) {
|
||||
*name = new GString(s);
|
||||
- (*name)->append(ext);
|
||||
- fd = open((*name)->getCString(), O_WRONLY | O_CREAT | O_EXCL, 0600);
|
||||
-#endif
|
||||
} else {
|
||||
-#if HAVE_MKSTEMP
|
||||
- if ((s = getenv("TMPDIR"))) {
|
||||
- *name = new GString(s);
|
||||
- } else {
|
||||
- *name = new GString("/tmp");
|
||||
- }
|
||||
- (*name)->append("/XXXXXX");
|
||||
- fd = mkstemp((*name)->getCString());
|
||||
+ *name = new GString("/tmp");
|
||||
+ }
|
||||
+ (*name)->append("/XXXXXX");
|
||||
+ fd = mkstemp((*name)->getCString());
|
||||
#else // HAVE_MKSTEMP
|
||||
if (!(s = tmpnam(NULL))) {
|
||||
return gFalse;
|
||||
@@ -519,7 +501,7 @@
|
||||
*name = new GString(s);
|
||||
fd = open((*name)->getCString(), O_WRONLY | O_CREAT | O_EXCL, 0600);
|
||||
#endif // HAVE_MKSTEMP
|
||||
- }
|
||||
+
|
||||
if (fd < 0 || !(*f = fdopen(fd, mode))) {
|
||||
delete *name;
|
||||
return gFalse;
|
||||
57
xpdf-3.00-64bit.patch
Normal file
57
xpdf-3.00-64bit.patch
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
diff -up xpdf-3.02/goo/gmem.cc.BAD xpdf-3.02/goo/gmem.cc
|
||||
--- xpdf-3.02/goo/gmem.cc.BAD 2007-08-01 17:20:00.000000000 -0500
|
||||
+++ xpdf-3.02/goo/gmem.cc 2007-08-01 17:22:04.000000000 -0500
|
||||
@@ -47,9 +47,9 @@ static int gMemInUse = 0;
|
||||
|
||||
#endif /* DEBUG_MEM */
|
||||
|
||||
-void *gmalloc(int size) GMEM_EXCEP {
|
||||
+void *gmalloc(size_t size) GMEM_EXCEP {
|
||||
#ifdef DEBUG_MEM
|
||||
- int size1;
|
||||
+ size_t size1;
|
||||
char *mem;
|
||||
GMemHdr *hdr;
|
||||
void *data;
|
||||
@@ -106,11 +106,11 @@ void *gmalloc(int size) GMEM_EXCEP {
|
||||
#endif
|
||||
}
|
||||
|
||||
-void *grealloc(void *p, int size) GMEM_EXCEP {
|
||||
+void *grealloc(void *p, size_t size) GMEM_EXCEP {
|
||||
#ifdef DEBUG_MEM
|
||||
GMemHdr *hdr;
|
||||
void *q;
|
||||
- int oldSize;
|
||||
+ size_t oldSize;
|
||||
|
||||
if (size <= 0) {
|
||||
if (p) {
|
||||
@@ -195,7 +195,7 @@ void *greallocn(void *p, int nObjs, int
|
||||
|
||||
void gfree(void *p) {
|
||||
#ifdef DEBUG_MEM
|
||||
- int size;
|
||||
+ size_t size;
|
||||
GMemHdr *hdr;
|
||||
unsigned long *trl, *clr;
|
||||
|
||||
diff -up xpdf-3.02/goo/gmem.h.BAD xpdf-3.02/goo/gmem.h
|
||||
--- xpdf-3.02/goo/gmem.h.BAD 2007-08-01 17:23:11.000000000 -0500
|
||||
+++ xpdf-3.02/goo/gmem.h 2007-08-01 17:23:45.000000000 -0500
|
||||
@@ -36,13 +36,13 @@ extern "C" {
|
||||
* Same as malloc, but prints error message and exits if malloc()
|
||||
* returns NULL.
|
||||
*/
|
||||
-extern void *gmalloc(int size) GMEM_EXCEP;
|
||||
+extern void *gmalloc(size_t size) GMEM_EXCEP;
|
||||
|
||||
/*
|
||||
* Same as realloc, but prints error message and exits if realloc()
|
||||
* returns NULL. If <p> is NULL, calls malloc instead of realloc().
|
||||
*/
|
||||
-extern void *grealloc(void *p, int size) GMEM_EXCEP;
|
||||
+extern void *grealloc(void *p, size_t size) GMEM_EXCEP;
|
||||
|
||||
/*
|
||||
* These are similar to gmalloc and grealloc, but take an object count
|
||||
13
xpdf-3.00-core.patch
Normal file
13
xpdf-3.00-core.patch
Normal file
|
|
@ -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
|
||||
29
xpdf-3.00-gcc4.patch
Normal file
29
xpdf-3.00-gcc4.patch
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
--- xpdf-3.00/xpdf/TextOutputDev.h.orig 2005-06-13 10:11:17.000000000 +0200
|
||||
+++ xpdf-3.00/xpdf/TextOutputDev.h 2005-06-13 10:27:18.000000000 +0200
|
||||
@@ -169,7 +169,7 @@
|
||||
class TextLine {
|
||||
public:
|
||||
|
||||
- TextLine(TextBlock *blkA, int rotA, double baseA);
|
||||
+ TextLine(class TextBlock *blkA, int rotA, double baseA);
|
||||
~TextLine();
|
||||
|
||||
void addWord(TextWord *word);
|
||||
@@ -226,7 +226,7 @@
|
||||
class TextBlock {
|
||||
public:
|
||||
|
||||
- TextBlock(TextPage *pageA, int rotA);
|
||||
+ TextBlock(class TextPage *pageA, int rotA);
|
||||
~TextBlock();
|
||||
|
||||
void addWord(TextWord *word);
|
||||
@@ -416,7 +416,7 @@
|
||||
private:
|
||||
|
||||
void clear();
|
||||
- void assignColumns(TextLineFrag *frags, int nFrags, int rot);
|
||||
+ void assignColumns(class TextLineFrag *frags, int nFrags, int rot);
|
||||
int dumpFragment(Unicode *text, int len, UnicodeMap *uMap, GString *s);
|
||||
|
||||
GBool rawOrder; // keep text in content stream order
|
||||
13
xpdf-3.00-papersize.patch
Normal file
13
xpdf-3.00-papersize.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
--- xpdf-3.00/xpdf/config.h.orig 2004-11-29 17:14:12.583102885 +0100
|
||||
+++ xpdf-3.00/xpdf/config.h 2004-11-29 17:14:54.312235643 +0100
|
||||
@@ -41,8 +41,8 @@
|
||||
#define defPaperWidth 595 // ISO A4 (210x297 mm)
|
||||
#define defPaperHeight 842
|
||||
#else
|
||||
-#define defPaperWidth 612 // American letter (8.5x11")
|
||||
-#define defPaperHeight 792
|
||||
+#define defPaperWidth -1 // match
|
||||
+#define defPaperHeight -1
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
11
xpdf-3.00-xfont.patch
Normal file
11
xpdf-3.00-xfont.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
--- xpdf-3.00/xpdf/XPDFViewer.cc.orig 2004-10-12 12:24:57.055068037 +0200
|
||||
+++ xpdf-3.00/xpdf/XPDFViewer.cc 2004-10-12 12:24:47.707449614 +0200
|
||||
@@ -1742,7 +1742,7 @@
|
||||
aboutBigFont =
|
||||
createFontList("-*-times-bold-i-normal--20-*-*-*-*-*-iso8859-1");
|
||||
aboutVersionFont =
|
||||
- createFontList("-*-times-medium-r-normal--16-*-*-*-*-*-iso8859-1");
|
||||
+ createFontList("-*-times-medium-r-normal--14-*-*-*-*-*-iso8859-1");
|
||||
aboutFixedFont =
|
||||
createFontList("-*-courier-medium-r-normal--12-*-*-*-*-*-iso8859-1");
|
||||
|
||||
34
xpdf-3.01-crash.patch
Normal file
34
xpdf-3.01-crash.patch
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
--- xpdf-3.00/splash/Splash.cc.tn 2005-07-25 09:59:45.000000000 +0200
|
||||
+++ xpdf-3.00/splash/Splash.cc 2005-07-25 10:00:58.000000000 +0200
|
||||
@@ -636,6 +641,11 @@
|
||||
|
||||
xPath = new SplashXPath(path, state->flatness, gTrue);
|
||||
xPath->sort();
|
||||
+ if (!&xPath->segs[0])
|
||||
+ {
|
||||
+ delete xPath;
|
||||
+ return splashErrEmptyPath;
|
||||
+ }
|
||||
scanner = new SplashXPathScanner(xPath, eo);
|
||||
|
||||
// get the min and max x and y values
|
||||
--- xpdf-3.00/fofi/FoFiType1.cc.tn 2005-07-25 10:34:04.000000000 +0200
|
||||
+++ xpdf-3.00/fofi/FoFiType1.cc 2005-07-25 10:41:37.000000000 +0200
|
||||
@@ -187,9 +187,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;
|
||||
}
|
||||
}
|
||||
line = line1;
|
||||
77
xpdf-3.01-freetype-internals.patch
Normal file
77
xpdf-3.01-freetype-internals.patch
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
--- xpdf-3.01/splash/SplashFTFont.cc.orig 2006-07-14 10:55:18.000000000 +0200
|
||||
+++ xpdf-3.01/splash/SplashFTFont.cc 2006-07-14 10:55:25.000000000 +0200
|
||||
@@ -14,7 +14,8 @@
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_OUTLINE_H
|
||||
-#include FT_INTERNAL_OBJECTS_H // needed for FT_New_Size decl
|
||||
+#include FT_SIZES_H // needed for FT_New_Size decl
|
||||
+#include FT_GLYPH_H
|
||||
#include "gmem.h"
|
||||
#include "SplashMath.h"
|
||||
#include "SplashGlyphBitmap.h"
|
||||
@@ -25,11 +26,12 @@
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
-static int glyphPathMoveTo(FT_Vector *pt, void *path);
|
||||
-static int glyphPathLineTo(FT_Vector *pt, void *path);
|
||||
-static int glyphPathConicTo(FT_Vector *ctrl, FT_Vector *pt, void *path);
|
||||
-static int glyphPathCubicTo(FT_Vector *ctrl1, FT_Vector *ctrl2,
|
||||
- FT_Vector *pt, void *path);
|
||||
+static int glyphPathMoveTo( const FT_Vector *pt, void *path);
|
||||
+static int glyphPathLineTo( const FT_Vector *pt, void *path);
|
||||
+static int glyphPathConicTo( const FT_Vector *ctrl, const FT_Vector *pt,
|
||||
+ void* path );
|
||||
+static int glyphPathCubicTo( const FT_Vector *ctrl1, const FT_Vector *ctrl2,
|
||||
+ const FT_Vector *pt, void *path);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// SplashFTFont
|
||||
@@ -210,7 +212,7 @@
|
||||
};
|
||||
|
||||
SplashPath *SplashFTFont::getGlyphPath(int c) {
|
||||
- static FT_Outline_Funcs outlineFuncs = {
|
||||
+ static const FT_Outline_Funcs outlineFuncs = {
|
||||
&glyphPathMoveTo,
|
||||
&glyphPathLineTo,
|
||||
&glyphPathConicTo,
|
||||
@@ -249,7 +251,7 @@
|
||||
return path.path;
|
||||
}
|
||||
|
||||
-static int glyphPathMoveTo(FT_Vector *pt, void *path) {
|
||||
+static int glyphPathMoveTo( const FT_Vector *pt, void *path) {
|
||||
SplashFTFontPath *p = (SplashFTFontPath *)path;
|
||||
|
||||
if (p->needClose) {
|
||||
@@ -260,7 +262,7 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int glyphPathLineTo(FT_Vector *pt, void *path) {
|
||||
+static int glyphPathLineTo(const FT_Vector *pt, void *path) {
|
||||
SplashFTFontPath *p = (SplashFTFontPath *)path;
|
||||
|
||||
p->path->lineTo(pt->x / 64.0, -pt->y / 64.0);
|
||||
@@ -268,7 +270,7 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int glyphPathConicTo(FT_Vector *ctrl, FT_Vector *pt, void *path) {
|
||||
+static int glyphPathConicTo(const FT_Vector *ctrl, const FT_Vector *pt, void *path) {
|
||||
SplashFTFontPath *p = (SplashFTFontPath *)path;
|
||||
SplashCoord x0, y0, x1, y1, x2, y2, x3, y3, xc, yc;
|
||||
|
||||
@@ -306,8 +308,8 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int glyphPathCubicTo(FT_Vector *ctrl1, FT_Vector *ctrl2,
|
||||
- FT_Vector *pt, void *path) {
|
||||
+static int glyphPathCubicTo(const FT_Vector *ctrl1, const FT_Vector *ctrl2,
|
||||
+ const FT_Vector *pt, void *path) {
|
||||
SplashFTFontPath *p = (SplashFTFontPath *)path;
|
||||
|
||||
p->path->curveTo(ctrl1->x / 64.0, -ctrl1->y / 64.0,
|
||||
49
xpdf-3.01-nocmap.patch
Normal file
49
xpdf-3.01-nocmap.patch
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
--- xpdf-3.01/xpdf-chinese-traditional/add-to-xpdfrc.NOCMAP 2006-09-25 15:26:58.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-chinese-traditional/add-to-xpdfrc 2006-09-25 15:27:04.000000000 -0500
|
||||
@@ -2,7 +2,7 @@
|
||||
cidToUnicode Adobe-CNS1 /usr/share/xpdf/chinese-traditional/Adobe-CNS1.cidToUnicode
|
||||
unicodeMap Big5 /usr/share/xpdf/chinese-traditional/Big5.unicodeMap
|
||||
unicodeMap Big5ascii /usr/share/xpdf/chinese-traditional/Big5ascii.unicodeMap
|
||||
-cMapDir Adobe-CNS1 /usr/share/xpdf/chinese-traditional/CMap
|
||||
-toUnicodeDir /usr/share/xpdf/chinese-traditional/CMap
|
||||
+#cMapDir Adobe-CNS1 /usr/share/xpdf/chinese-traditional/CMap
|
||||
+#toUnicodeDir /usr/share/xpdf/chinese-traditional/CMap
|
||||
#displayCIDFontTT Adobe-CNS1 /usr/..../bkai00mp.ttf
|
||||
#----- end Chinese Traditional support package
|
||||
--- xpdf-3.01/xpdf-korean/add-to-xpdfrc.NOCMAP 2006-09-25 15:27:33.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-korean/add-to-xpdfrc 2006-09-25 15:27:48.000000000 -0500
|
||||
@@ -1,8 +1,8 @@
|
||||
#----- begin Korean support package (2005-jul-07)
|
||||
cidToUnicode Adobe-Korea1 /usr/share/xpdf/korean/Adobe-Korea1.cidToUnicode
|
||||
unicodeMap ISO-2022-KR /usr/share/xpdf/korean/ISO-2022-KR.unicodeMap
|
||||
-cMapDir Adobe-Korea1 /usr/share/xpdf/korean/CMap
|
||||
-toUnicodeDir /usr/share/xpdf/korean/CMap
|
||||
+#cMapDir Adobe-Korea1 /usr/share/xpdf/korean/CMap
|
||||
+#toUnicodeDir /usr/share/xpdf/korean/CMap
|
||||
#displayCIDFontTT Adobe-Korea1 /usr/..../batang.ttf"
|
||||
#displayCIDFontTT Unidocs-Korea1 /usr/..../batang.ttf"
|
||||
#----- end Korean support package
|
||||
--- xpdf-3.01/xpdf-chinese-simplified/add-to-xpdfrc.NOCMAP 2006-09-25 15:26:43.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-chinese-simplified/add-to-xpdfrc 2006-09-25 15:26:49.000000000 -0500
|
||||
@@ -3,7 +3,7 @@ cidToUnicode Adobe-GB1 /usr/share/xpdf/c
|
||||
unicodeMap ISO-2022-CN /usr/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap
|
||||
unicodeMap EUC-CN /usr/share/xpdf/chinese-simplified/EUC-CN.unicodeMap
|
||||
unicodeMap GBK /usr/share/xpdf/chinese-simplified/GBK.unicodeMap
|
||||
-cMapDir Adobe-GB1 /usr/share/xpdf/chinese-simplified/CMap
|
||||
-toUnicodeDir /usr/share/xpdf/chinese-simplified/CMap
|
||||
+#cMapDir Adobe-GB1 /usr/share/xpdf/chinese-simplified/CMap
|
||||
+#toUnicodeDir /usr/share/xpdf/chinese-simplified/CMap
|
||||
#displayCIDFontTT Adobe-GB1 /usr/..../gkai00mp.ttf
|
||||
#----- end Chinese Simplified support package
|
||||
--- xpdf-3.01/xpdf-japanese/add-to-xpdfrc.NOCMAP 2006-09-25 15:27:16.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-japanese/add-to-xpdfrc 2006-09-25 15:27:20.000000000 -0500
|
||||
@@ -3,7 +3,7 @@ cidToUnicode Adobe-Japan1 /usr/share/xpd
|
||||
unicodeMap ISO-2022-JP /usr/share/xpdf/japanese/ISO-2022-JP.unicodeMap
|
||||
unicodeMap EUC-JP /usr/share/xpdf/japanese/EUC-JP.unicodeMap
|
||||
unicodeMap Shift-JIS /usr/share/xpdf/japanese/Shift-JIS.unicodeMap
|
||||
-cMapDir Adobe-Japan1 /usr/share/xpdf/japanese/CMap
|
||||
-toUnicodeDir /usr/share/xpdf/japanese/CMap
|
||||
+#cMapDir Adobe-Japan1 /usr/share/xpdf/japanese/CMap
|
||||
+#toUnicodeDir /usr/share/xpdf/japanese/CMap
|
||||
#displayCIDFontTT Adobe-Japan1 /usr/..../kochi-mincho.ttf
|
||||
#----- end Japanese support package
|
||||
258
xpdf-3.01-redhat-new.patch
Normal file
258
xpdf-3.01-redhat-new.patch
Normal file
|
|
@ -0,0 +1,258 @@
|
|||
--- xpdf-3.01/xpdf-chinese-traditional/add-to-xpdfrc.orig 2004-07-27 17:28:07.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-chinese-traditional/add-to-xpdfrc 2006-09-25 12:58:50.000000000 -0500
|
||||
@@ -1,8 +1,8 @@
|
||||
#----- begin Chinese Traditional support package (2004-jul-27)
|
||||
-cidToUnicode Adobe-CNS1 /usr/local/share/xpdf/chinese-traditional/Adobe-CNS1.cidToUnicode
|
||||
-unicodeMap Big5 /usr/local/share/xpdf/chinese-traditional/Big5.unicodeMap
|
||||
-unicodeMap Big5ascii /usr/local/share/xpdf/chinese-traditional/Big5ascii.unicodeMap
|
||||
-cMapDir Adobe-CNS1 /usr/local/share/xpdf/chinese-traditional/CMap
|
||||
-toUnicodeDir /usr/local/share/xpdf/chinese-traditional/CMap
|
||||
+cidToUnicode Adobe-CNS1 /usr/share/xpdf/chinese-traditional/Adobe-CNS1.cidToUnicode
|
||||
+unicodeMap Big5 /usr/share/xpdf/chinese-traditional/Big5.unicodeMap
|
||||
+unicodeMap Big5ascii /usr/share/xpdf/chinese-traditional/Big5ascii.unicodeMap
|
||||
+cMapDir Adobe-CNS1 /usr/share/xpdf/chinese-traditional/CMap
|
||||
+toUnicodeDir /usr/share/xpdf/chinese-traditional/CMap
|
||||
#displayCIDFontTT Adobe-CNS1 /usr/..../bkai00mp.ttf
|
||||
#----- end Chinese Traditional support package
|
||||
--- xpdf-3.01/xpdf-korean/add-to-xpdfrc.orig 2005-07-07 13:05:05.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-korean/add-to-xpdfrc 2006-09-25 12:56:15.000000000 -0500
|
||||
@@ -1,8 +1,8 @@
|
||||
#----- begin Korean support package (2005-jul-07)
|
||||
-cidToUnicode Adobe-Korea1 /usr/local/share/xpdf/korean/Adobe-Korea1.cidToUnicode
|
||||
-unicodeMap ISO-2022-KR /usr/local/share/xpdf/korean/ISO-2022-KR.unicodeMap
|
||||
-cMapDir Adobe-Korea1 /usr/local/share/xpdf/korean/CMap
|
||||
-toUnicodeDir /usr/local/share/xpdf/korean/CMap
|
||||
+cidToUnicode Adobe-Korea1 /usr/share/xpdf/korean/Adobe-Korea1.cidToUnicode
|
||||
+unicodeMap ISO-2022-KR /usr/share/xpdf/korean/ISO-2022-KR.unicodeMap
|
||||
+cMapDir Adobe-Korea1 /usr/share/xpdf/korean/CMap
|
||||
+toUnicodeDir /usr/share/xpdf/korean/CMap
|
||||
#displayCIDFontTT Adobe-Korea1 /usr/..../batang.ttf"
|
||||
#displayCIDFontTT Unidocs-Korea1 /usr/..../batang.ttf"
|
||||
#----- end Korean support package
|
||||
--- xpdf-3.01/xpdf-chinese-simplified/add-to-xpdfrc.orig 2004-07-27 17:28:08.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-chinese-simplified/add-to-xpdfrc 2006-09-25 12:57:18.000000000 -0500
|
||||
@@ -1,9 +1,9 @@
|
||||
#----- begin Chinese Simplified support package (2004-jul-27)
|
||||
-cidToUnicode Adobe-GB1 /usr/local/share/xpdf/chinese-simplified/Adobe-GB1.cidToUnicode
|
||||
-unicodeMap ISO-2022-CN /usr/local/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap
|
||||
-unicodeMap EUC-CN /usr/local/share/xpdf/chinese-simplified/EUC-CN.unicodeMap
|
||||
-unicodeMap GBK /usr/local/share/xpdf/chinese-simplified/GBK.unicodeMap
|
||||
-cMapDir Adobe-GB1 /usr/local/share/xpdf/chinese-simplified/CMap
|
||||
-toUnicodeDir /usr/local/share/xpdf/chinese-simplified/CMap
|
||||
+cidToUnicode Adobe-GB1 /usr/share/xpdf/chinese-simplified/Adobe-GB1.cidToUnicode
|
||||
+unicodeMap ISO-2022-CN /usr/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap
|
||||
+unicodeMap EUC-CN /usr/share/xpdf/chinese-simplified/EUC-CN.unicodeMap
|
||||
+unicodeMap GBK /usr/share/xpdf/chinese-simplified/GBK.unicodeMap
|
||||
+cMapDir Adobe-GB1 /usr/share/xpdf/chinese-simplified/CMap
|
||||
+toUnicodeDir /usr/share/xpdf/chinese-simplified/CMap
|
||||
#displayCIDFontTT Adobe-GB1 /usr/..../gkai00mp.ttf
|
||||
#----- end Chinese Simplified support package
|
||||
--- xpdf-3.01/xpdf-japanese/add-to-xpdfrc.orig 2004-07-27 17:28:07.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-japanese/add-to-xpdfrc 2006-09-25 12:58:10.000000000 -0500
|
||||
@@ -1,9 +1,9 @@
|
||||
#----- begin Japanese support package (2004-jul-27)
|
||||
-cidToUnicode Adobe-Japan1 /usr/local/share/xpdf/japanese/Adobe-Japan1.cidToUnicode
|
||||
-unicodeMap ISO-2022-JP /usr/local/share/xpdf/japanese/ISO-2022-JP.unicodeMap
|
||||
-unicodeMap EUC-JP /usr/local/share/xpdf/japanese/EUC-JP.unicodeMap
|
||||
-unicodeMap Shift-JIS /usr/local/share/xpdf/japanese/Shift-JIS.unicodeMap
|
||||
-cMapDir Adobe-Japan1 /usr/local/share/xpdf/japanese/CMap
|
||||
-toUnicodeDir /usr/local/share/xpdf/japanese/CMap
|
||||
+cidToUnicode Adobe-Japan1 /usr/share/xpdf/japanese/Adobe-Japan1.cidToUnicode
|
||||
+unicodeMap ISO-2022-JP /usr/share/xpdf/japanese/ISO-2022-JP.unicodeMap
|
||||
+unicodeMap EUC-JP /usr/share/xpdf/japanese/EUC-JP.unicodeMap
|
||||
+unicodeMap Shift-JIS /usr/share/xpdf/japanese/Shift-JIS.unicodeMap
|
||||
+cMapDir Adobe-Japan1 /usr/share/xpdf/japanese/CMap
|
||||
+toUnicodeDir /usr/share/xpdf/japanese/CMap
|
||||
#displayCIDFontTT Adobe-Japan1 /usr/..../kochi-mincho.ttf
|
||||
#----- end Japanese support package
|
||||
--- xpdf-3.01/doc/xpdfrc.5.orig 2005-08-17 00:34:30.000000000 -0500
|
||||
+++ xpdf-3.01/doc/xpdfrc.5 2006-09-25 12:54:53.000000000 -0500
|
||||
@@ -7,7 +7,7 @@ All of the Xpdf tools read a single conf
|
||||
.I .xpdfrc
|
||||
file in your home directory, it will be read. Otherwise, a
|
||||
system-wide configuration file will be read from
|
||||
-.IR /usr/local/etc/xpdfrc ,
|
||||
+.IR /etc/xpdfrc ,
|
||||
if it exists. (This is its default location; depending on build
|
||||
options, it may be placed elsewhere.) On Win32 systems, the
|
||||
.I xpdfrc
|
||||
@@ -459,7 +459,7 @@ urlCommand "netscape -remote 'openU
|
||||
.fi
|
||||
.SH FILES
|
||||
.TP
|
||||
-.B /usr/local/etc/xpdfrc
|
||||
+.B /etc/xpdfrc
|
||||
This is the default location for the system-wide configuration file.
|
||||
Depending on build options, it may be placed elsewhere.
|
||||
.TP
|
||||
--- xpdf-3.01/doc/xpdf.1.orig 2005-08-17 00:34:30.000000000 -0500
|
||||
+++ xpdf-3.01/doc/xpdf.1 2006-09-25 12:54:53.000000000 -0500
|
||||
@@ -41,7 +41,7 @@ xpdf
|
||||
.SH CONFIGURATION FILE
|
||||
Xpdf reads a configuration file at startup. It first tries to find
|
||||
the user's private config file, ~/.xpdfrc. If that doesn't exist, it
|
||||
-looks for a system-wide config file, typically /usr/local/etc/xpdfrc
|
||||
+looks for a system-wide config file, typically /etc/xpdfrc
|
||||
(but this location can be changed when xpdf is built). See the
|
||||
.BR xpdfrc (5)
|
||||
man page for details.
|
||||
--- xpdf-3.01/doc/pdfimages.1.orig 2005-08-17 00:34:30.000000000 -0500
|
||||
+++ xpdf-3.01/doc/pdfimages.1 2006-09-25 12:54:53.000000000 -0500
|
||||
@@ -29,7 +29,7 @@ color inversion, etc. done by the PDF co
|
||||
Pdfimages reads a configuration file at startup. It first tries to
|
||||
find the user's private config file, ~/.xpdfrc. If that doesn't
|
||||
exist, it looks for a system-wide config file, typically
|
||||
-/usr/local/etc/xpdfrc (but this location can be changed when pdfimages
|
||||
+/etc/xpdfrc (but this location can be changed when pdfimages
|
||||
is built). See the
|
||||
.BR xpdfrc (5)
|
||||
man page for details.
|
||||
--- xpdf-3.01/xpdf-chinese-traditional/README.orig 2006-09-25 13:33:34.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-chinese-traditional/README 2006-09-25 13:37:33.000000000 -0500
|
||||
@@ -19,13 +19,13 @@ Contents:
|
||||
|
||||
Place all of these files in a directory, typically:
|
||||
|
||||
- Unix - /usr/local/share/xpdf/chinese-traditional
|
||||
+ Unix - /usr/share/xpdf/chinese-traditional
|
||||
Win32 - C:\Program Files\xpdf\chinese-traditional
|
||||
|
||||
Add the contents of the "add-to-xpdfrc" file to your system-wide
|
||||
xpdfrc config file, which is typically:
|
||||
|
||||
- Unix - /usr/local/etc/xpdfrc
|
||||
+ Unix - /etc/xpdfrc
|
||||
Win32 - C:\Program Files\xpdf\xpdfrc
|
||||
|
||||
Alternatively, on Unix systems you can add these lines to your
|
||||
--- xpdf-3.01/xpdf-korean/README.orig 2006-09-25 13:34:27.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-korean/README 2006-09-25 13:38:26.000000000 -0500
|
||||
@@ -18,13 +18,13 @@ Contents:
|
||||
|
||||
Place all of these files in a directory, typically:
|
||||
|
||||
- Unix - /usr/local/share/xpdf/korean
|
||||
+ Unix - /usr/share/xpdf/korean
|
||||
Win32 - C:\Program Files\xpdf\korean
|
||||
|
||||
Add the contents of the "add-to-xpdfrc" file to your system-wide
|
||||
xpdfrc config file, which is typically:
|
||||
|
||||
- Unix - /usr/local/etc/xpdfrc
|
||||
+ Unix - /etc/xpdfrc
|
||||
Win32 - C:\Program Files\Xpdf\xpdfrc
|
||||
|
||||
Alternatively, on Unix systems you can add these lines to your
|
||||
--- xpdf-3.01/xpdf-chinese-simplified/README.orig 2006-09-25 13:33:18.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-chinese-simplified/README 2006-09-25 13:37:45.000000000 -0500
|
||||
@@ -20,13 +20,13 @@ Contents:
|
||||
|
||||
Place all of these files in a directory, typically:
|
||||
|
||||
- Unix - /usr/local/share/xpdf/chinese-simplified
|
||||
+ Unix - /usr/share/xpdf/chinese-simplified
|
||||
Win32 - C:\Program Files\xpdf\chinese-simplified
|
||||
|
||||
Add the contents of the "add-to-xpdfrc" file to your system-wide
|
||||
xpdfrc config file, which is typically:
|
||||
|
||||
- Unix - /usr/local/etc/xpdfrc
|
||||
+ Unix - /etc/xpdfrc
|
||||
Win32 - C:\Program Files\xpdf\xpdfrc
|
||||
|
||||
Alternatively, on Unix systems you can add these lines to your
|
||||
--- xpdf-3.01/xpdf-japanese/README.orig 2006-09-25 13:33:47.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-japanese/README 2006-09-25 13:38:12.000000000 -0500
|
||||
@@ -20,13 +20,13 @@ Contents:
|
||||
|
||||
Place all of these files in a directory, typically:
|
||||
|
||||
- Unix - /usr/local/share/xpdf/japanese
|
||||
+ Unix - /usr/share/xpdf/japanese
|
||||
Win32 - C:\Program Files\xpdf\japanese
|
||||
|
||||
Add the contents of the "add-to-xpdfrc" file to your system-wide
|
||||
xpdfrc config file, which is typically:
|
||||
|
||||
- Unix - /usr/local/etc/xpdfrc
|
||||
+ Unix - /etc/xpdfrc
|
||||
Win32 - C:\Program Files\xpdf\xpdfrc
|
||||
|
||||
Alternatively, on Unix systems you can add these lines to your
|
||||
--- xpdf-3.01/xpdf-thai/README.BAD 2006-09-25 15:42:22.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-thai/README 2006-09-25 15:42:33.000000000 -0500
|
||||
@@ -18,13 +18,13 @@ Contents:
|
||||
|
||||
Place all of these files in a directory, typically:
|
||||
|
||||
- Unix - /usr/local/share/xpdf/thai
|
||||
+ Unix - /usr/share/xpdf/thai
|
||||
Win32 - C:\Program Files\xpdf\thai
|
||||
|
||||
Add the contents of the "add-to-xpdfrc" file to your system-wide
|
||||
xpdfrc config file, which is typically:
|
||||
|
||||
- Unix - /usr/local/etc/xpdfrc
|
||||
+ Unix - /etc/xpdfrc
|
||||
Win32 - C:\Program Files\xpdf\xpdfrc
|
||||
|
||||
Alternatively, on Unix systems you can add these lines to your
|
||||
--- xpdf-3.01/xpdf-thai/add-to-xpdfrc.BAD 2006-09-25 15:43:35.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-thai/add-to-xpdfrc 2006-09-25 15:43:44.000000000 -0500
|
||||
@@ -1,4 +1,4 @@
|
||||
#----- begin Thai support package (2002-jan-16)
|
||||
-nameToUnicode /usr/local/share/xpdf/thai/Thai.nameToUnicode
|
||||
-unicodeMap TIS-620 /usr/local/share/xpdf/thai/TIS-620.unicodeMap
|
||||
+nameToUnicode /usr/share/xpdf/thai/Thai.nameToUnicode
|
||||
+unicodeMap TIS-620 /usr/share/xpdf/thai/TIS-620.unicodeMap
|
||||
#----- end Thai support package
|
||||
--- xpdf-3.01/xpdf-cyrillic/README.BAD 2006-09-25 15:42:48.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-cyrillic/README 2006-09-25 15:42:59.000000000 -0500
|
||||
@@ -18,13 +18,13 @@ Contents:
|
||||
|
||||
Place all of these files in a directory, typically:
|
||||
|
||||
- Unix - /usr/local/share/xpdf/cyrillic
|
||||
+ Unix - /usr/share/xpdf/cyrillic
|
||||
Win32 - C:\Program Files\xpdf\cyrillic
|
||||
|
||||
Add the contents of the "add-to-xpdfrc" file to your system-wide
|
||||
xpdfrc config file, which is typically:
|
||||
|
||||
- Unix - /usr/local/etc/xpdfrc
|
||||
+ Unix - /etc/xpdfrc
|
||||
Win32 - C:\Program Files\xpdf\xpdfrc
|
||||
|
||||
Alternatively, on Unix systems you can add these lines to your
|
||||
--- xpdf-3.01/xpdf-cyrillic/add-to-xpdfrc.BAD 2006-09-25 15:43:28.000000000 -0500
|
||||
+++ xpdf-3.01/xpdf-cyrillic/add-to-xpdfrc 2006-09-25 15:43:11.000000000 -0500
|
||||
@@ -1,4 +1,4 @@
|
||||
#----- begin Cyrillic support package (2003-jun-28)
|
||||
-nameToUnicode /usr/local/share/xpdf/cyrillic/Bulgarian.nameToUnicode
|
||||
-unicodeMap KOI8-R /usr/local/share/xpdf/cyrillic/KOI8-R.unicodeMap
|
||||
+nameToUnicode /usr/share/xpdf/cyrillic/Bulgarian.nameToUnicode
|
||||
+unicodeMap KOI8-R /usr/share/xpdf/cyrillic/KOI8-R.unicodeMap
|
||||
#----- end Cyrillic support package
|
||||
--- xpdf-3.03/doc/sample-xpdfrc.orig 2011-08-15 17:08:53.000000000 -0400
|
||||
+++ xpdf-3.03/doc/sample-xpdfrc 2011-08-22 13:41:14.405172432 -0400
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
# Set the default PostScript file or command.
|
||||
|
||||
-#psFile "|lpr -Pmyprinter"
|
||||
+psFile "|lpr"
|
||||
|
||||
# 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
|
||||
@@ -89,4 +89,10 @@
|
||||
# clicked.
|
||||
|
||||
#launchCommand viewer-script
|
||||
-#urlCommand "netscape -remote 'openURL(%s)'"
|
||||
+urlCommand "xdg-open '%s'"
|
||||
+
|
||||
+# CJK
|
||||
+include /etc/xpdf/add-to-xpdfrc.japanese
|
||||
+include /etc/xpdf/add-to-xpdfrc.korean
|
||||
+include /etc/xpdf/add-to-xpdfrc.chinese-simplified
|
||||
+include /etc/xpdf/add-to-xpdfrc.chinese-traditional
|
||||
36
xpdf-3.01-resize.patch
Normal file
36
xpdf-3.01-resize.patch
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
--- xpdf-3.01/xpdf/XPDFCore.cc.resize 2005-10-06 23:40:10.000000000 +0200
|
||||
+++ xpdf-3.01/xpdf/XPDFCore.cc 2005-10-06 23:40:10.000000000 +0200
|
||||
@@ -979,6 +979,9 @@
|
||||
XPDFCore *core = (XPDFCore *)ptr;
|
||||
XEvent event;
|
||||
Widget top;
|
||||
+ Window rootWin;
|
||||
+ int x1, y1;
|
||||
+ Guint w1, h1, bw1, depth1;
|
||||
Arg args[2];
|
||||
int n;
|
||||
Dimension w, h;
|
||||
@@ -986,15 +989,20 @@
|
||||
|
||||
// find the top-most widget which has an associated window, and look
|
||||
// for a pending ConfigureNotify in the event queue -- if there is
|
||||
- // one, that means we're still resizing, and we want to skip the
|
||||
- // current event
|
||||
+ // one, and it specifies a different width or height, that means
|
||||
+ // we're still resizing, and we want to skip the current event
|
||||
for (top = core->parentWidget;
|
||||
XtParent(top) && XtWindow(XtParent(top));
|
||||
top = XtParent(top)) ;
|
||||
if (XCheckTypedWindowEvent(core->display, XtWindow(top),
|
||||
ConfigureNotify, &event)) {
|
||||
XPutBackEvent(core->display, &event);
|
||||
- return;
|
||||
+ XGetGeometry(core->display, event.xconfigure.window,
|
||||
+ &rootWin, &x1, &y1, &w1, &h1, &bw1, &depth1);
|
||||
+ if ((Guint)event.xconfigure.width != w1 ||
|
||||
+ (Guint)event.xconfigure.height != h1) {
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
|
||||
n = 0;
|
||||
471
xpdf-3.01pl2.patch
Normal file
471
xpdf-3.01pl2.patch
Normal file
|
|
@ -0,0 +1,471 @@
|
|||
diff -cr xpdf-3.01.orig/goo/gmem.c xpdf-3.01/goo/gmem.c
|
||||
*** xpdf-3.01.orig/goo/gmem.c Tue Aug 16 22:34:30 2005
|
||||
--- xpdf-3.01/goo/gmem.c Tue Jan 17 17:03:57 2006
|
||||
***************
|
||||
*** 11,16 ****
|
||||
--- 11,17 ----
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
+ #include <limits.h>
|
||||
#include "gmem.h"
|
||||
|
||||
#ifdef DEBUG_MEM
|
||||
***************
|
||||
*** 63,69 ****
|
||||
int lst;
|
||||
unsigned long *trl, *p;
|
||||
|
||||
! if (size == 0)
|
||||
return NULL;
|
||||
size1 = gMemDataSize(size);
|
||||
if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) {
|
||||
--- 64,70 ----
|
||||
int lst;
|
||||
unsigned long *trl, *p;
|
||||
|
||||
! if (size <= 0)
|
||||
return NULL;
|
||||
size1 = gMemDataSize(size);
|
||||
if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) {
|
||||
***************
|
||||
*** 86,92 ****
|
||||
#else
|
||||
void *p;
|
||||
|
||||
! if (size == 0)
|
||||
return NULL;
|
||||
if (!(p = malloc(size))) {
|
||||
fprintf(stderr, "Out of memory\n");
|
||||
--- 87,93 ----
|
||||
#else
|
||||
void *p;
|
||||
|
||||
! if (size <= 0)
|
||||
return NULL;
|
||||
if (!(p = malloc(size))) {
|
||||
fprintf(stderr, "Out of memory\n");
|
||||
***************
|
||||
*** 102,108 ****
|
||||
void *q;
|
||||
int oldSize;
|
||||
|
||||
! if (size == 0) {
|
||||
if (p)
|
||||
gfree(p);
|
||||
return NULL;
|
||||
--- 103,109 ----
|
||||
void *q;
|
||||
int oldSize;
|
||||
|
||||
! if (size <= 0) {
|
||||
if (p)
|
||||
gfree(p);
|
||||
return NULL;
|
||||
***************
|
||||
*** 120,126 ****
|
||||
#else
|
||||
void *q;
|
||||
|
||||
! if (size == 0) {
|
||||
if (p)
|
||||
free(p);
|
||||
return NULL;
|
||||
--- 121,127 ----
|
||||
#else
|
||||
void *q;
|
||||
|
||||
! if (size <= 0) {
|
||||
if (p)
|
||||
free(p);
|
||||
return NULL;
|
||||
***************
|
||||
*** 140,147 ****
|
||||
void *gmallocn(int nObjs, int objSize) {
|
||||
int n;
|
||||
|
||||
n = nObjs * objSize;
|
||||
! if (objSize == 0 || n / objSize != nObjs) {
|
||||
fprintf(stderr, "Bogus memory allocation size\n");
|
||||
exit(1);
|
||||
}
|
||||
--- 141,151 ----
|
||||
void *gmallocn(int nObjs, int objSize) {
|
||||
int n;
|
||||
|
||||
+ if (nObjs == 0) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
n = nObjs * objSize;
|
||||
! if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
|
||||
fprintf(stderr, "Bogus memory allocation size\n");
|
||||
exit(1);
|
||||
}
|
||||
***************
|
||||
*** 151,158 ****
|
||||
void *greallocn(void *p, int nObjs, int objSize) {
|
||||
int n;
|
||||
|
||||
n = nObjs * objSize;
|
||||
! if (objSize == 0 || n / objSize != nObjs) {
|
||||
fprintf(stderr, "Bogus memory allocation size\n");
|
||||
exit(1);
|
||||
}
|
||||
--- 155,168 ----
|
||||
void *greallocn(void *p, int nObjs, int objSize) {
|
||||
int n;
|
||||
|
||||
+ if (nObjs == 0) {
|
||||
+ if (p) {
|
||||
+ gfree(p);
|
||||
+ }
|
||||
+ return NULL;
|
||||
+ }
|
||||
n = nObjs * objSize;
|
||||
! if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
|
||||
fprintf(stderr, "Bogus memory allocation size\n");
|
||||
exit(1);
|
||||
}
|
||||
diff -cr xpdf-3.01.orig/xpdf/JBIG2Stream.cc xpdf-3.01/xpdf/JBIG2Stream.cc
|
||||
*** xpdf-3.01.orig/xpdf/JBIG2Stream.cc Tue Aug 16 22:34:31 2005
|
||||
--- xpdf-3.01/xpdf/JBIG2Stream.cc Tue Jan 17 17:29:46 2006
|
||||
***************
|
||||
*** 13,18 ****
|
||||
--- 13,19 ----
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
+ #include <limits.h>
|
||||
#include "GList.h"
|
||||
#include "Error.h"
|
||||
#include "JArithmeticDecoder.h"
|
||||
***************
|
||||
*** 681,686 ****
|
||||
--- 682,691 ----
|
||||
w = wA;
|
||||
h = hA;
|
||||
line = (wA + 7) >> 3;
|
||||
+ if (w <= 0 || h <= 0 || line <= 0 || h >= (INT_MAX - 1) / line) {
|
||||
+ data = NULL;
|
||||
+ return;
|
||||
+ }
|
||||
// need to allocate one extra guard byte for use in combine()
|
||||
data = (Guchar *)gmalloc(h * line + 1);
|
||||
data[h * line] = 0;
|
||||
***************
|
||||
*** 692,697 ****
|
||||
--- 697,706 ----
|
||||
w = bitmap->w;
|
||||
h = bitmap->h;
|
||||
line = bitmap->line;
|
||||
+ if (w <= 0 || h <= 0 || line <= 0 || h >= (INT_MAX - 1) / line) {
|
||||
+ data = NULL;
|
||||
+ return;
|
||||
+ }
|
||||
// need to allocate one extra guard byte for use in combine()
|
||||
data = (Guchar *)gmalloc(h * line + 1);
|
||||
memcpy(data, bitmap->data, h * line);
|
||||
***************
|
||||
*** 720,726 ****
|
||||
}
|
||||
|
||||
void JBIG2Bitmap::expand(int newH, Guint pixel) {
|
||||
! if (newH <= h) {
|
||||
return;
|
||||
}
|
||||
// need to allocate one extra guard byte for use in combine()
|
||||
--- 729,735 ----
|
||||
}
|
||||
|
||||
void JBIG2Bitmap::expand(int newH, Guint pixel) {
|
||||
! if (newH <= h || line <= 0 || newH >= (INT_MAX - 1) / line) {
|
||||
return;
|
||||
}
|
||||
// need to allocate one extra guard byte for use in combine()
|
||||
***************
|
||||
*** 2294,2299 ****
|
||||
--- 2303,2316 ----
|
||||
!readUWord(&stepX) || !readUWord(&stepY)) {
|
||||
goto eofError;
|
||||
}
|
||||
+ if (w == 0 || h == 0 || w >= INT_MAX / h) {
|
||||
+ error(getPos(), "Bad bitmap size in JBIG2 halftone segment");
|
||||
+ return;
|
||||
+ }
|
||||
+ if (gridH == 0 || gridW >= INT_MAX / gridH) {
|
||||
+ error(getPos(), "Bad grid size in JBIG2 halftone segment");
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
// get pattern dictionary
|
||||
if (nRefSegs != 1) {
|
||||
diff -cr xpdf-3.01.orig/xpdf/JPXStream.cc xpdf-3.01/xpdf/JPXStream.cc
|
||||
*** xpdf-3.01.orig/xpdf/JPXStream.cc Tue Aug 16 22:34:31 2005
|
||||
--- xpdf-3.01/xpdf/JPXStream.cc Tue Jan 17 17:14:06 2006
|
||||
***************
|
||||
*** 12,17 ****
|
||||
--- 12,18 ----
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
+ #include <limits.h>
|
||||
#include "gmem.h"
|
||||
#include "Error.h"
|
||||
#include "JArithmeticDecoder.h"
|
||||
***************
|
||||
*** 818,823 ****
|
||||
--- 819,830 ----
|
||||
/ img.xTileSize;
|
||||
img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1)
|
||||
/ img.yTileSize;
|
||||
+ // check for overflow before allocating memory
|
||||
+ if (img.nXTiles <= 0 || img.nYTiles <= 0 ||
|
||||
+ img.nXTiles >= INT_MAX / img.nYTiles) {
|
||||
+ error(getPos(), "Bad tile count in JPX SIZ marker segment");
|
||||
+ return gFalse;
|
||||
+ }
|
||||
img.tiles = (JPXTile *)gmallocn(img.nXTiles * img.nYTiles,
|
||||
sizeof(JPXTile));
|
||||
for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
|
||||
diff -cr xpdf-3.01.orig/xpdf/Stream.cc xpdf-3.01/xpdf/Stream.cc
|
||||
*** xpdf-3.01.orig/xpdf/Stream.cc Tue Aug 16 22:34:31 2005
|
||||
--- xpdf-3.01/xpdf/Stream.cc Tue Jan 17 17:31:52 2006
|
||||
***************
|
||||
*** 15,20 ****
|
||||
--- 15,21 ----
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
+ #include <limits.h>
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
***************
|
||||
*** 406,418 ****
|
||||
--- 407,432 ----
|
||||
width = widthA;
|
||||
nComps = nCompsA;
|
||||
nBits = nBitsA;
|
||||
+ predLine = NULL;
|
||||
+ ok = gFalse;
|
||||
|
||||
nVals = width * nComps;
|
||||
+ if (width <= 0 || nComps <= 0 || nBits <= 0 ||
|
||||
+ nComps >= INT_MAX / nBits ||
|
||||
+ width >= INT_MAX / nComps / nBits ||
|
||||
+ nVals * nBits + 7 < 0) {
|
||||
+ return;
|
||||
+ }
|
||||
pixBytes = (nComps * nBits + 7) >> 3;
|
||||
rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
|
||||
+ if (rowBytes <= 0) {
|
||||
+ return;
|
||||
+ }
|
||||
predLine = (Guchar *)gmalloc(rowBytes);
|
||||
memset(predLine, 0, rowBytes);
|
||||
predIdx = rowBytes;
|
||||
+
|
||||
+ ok = gTrue;
|
||||
}
|
||||
|
||||
StreamPredictor::~StreamPredictor() {
|
||||
***************
|
||||
*** 1004,1009 ****
|
||||
--- 1018,1027 ----
|
||||
FilterStream(strA) {
|
||||
if (predictor != 1) {
|
||||
pred = new StreamPredictor(this, predictor, columns, colors, bits);
|
||||
+ if (!pred->isOk()) {
|
||||
+ delete pred;
|
||||
+ pred = NULL;
|
||||
+ }
|
||||
} else {
|
||||
pred = NULL;
|
||||
}
|
||||
***************
|
||||
*** 1259,1264 ****
|
||||
--- 1277,1285 ----
|
||||
if (columns < 1) {
|
||||
columns = 1;
|
||||
}
|
||||
+ if (columns + 4 <= 0) {
|
||||
+ columns = INT_MAX - 4;
|
||||
+ }
|
||||
rows = rowsA;
|
||||
endOfBlock = endOfBlockA;
|
||||
black = blackA;
|
||||
***************
|
||||
*** 2899,2904 ****
|
||||
--- 2920,2930 ----
|
||||
height = read16();
|
||||
width = read16();
|
||||
numComps = str->getChar();
|
||||
+ if (numComps <= 0 || numComps > 4) {
|
||||
+ error(getPos(), "Bad number of components in DCT stream");
|
||||
+ numComps = 0;
|
||||
+ return gFalse;
|
||||
+ }
|
||||
if (prec != 8) {
|
||||
error(getPos(), "Bad DCT precision %d", prec);
|
||||
return gFalse;
|
||||
***************
|
||||
*** 2925,2930 ****
|
||||
--- 2951,2961 ----
|
||||
height = read16();
|
||||
width = read16();
|
||||
numComps = str->getChar();
|
||||
+ if (numComps <= 0 || numComps > 4) {
|
||||
+ error(getPos(), "Bad number of components in DCT stream");
|
||||
+ numComps = 0;
|
||||
+ return gFalse;
|
||||
+ }
|
||||
if (prec != 8) {
|
||||
error(getPos(), "Bad DCT precision %d", prec);
|
||||
return gFalse;
|
||||
***************
|
||||
*** 2947,2952 ****
|
||||
--- 2978,2988 ----
|
||||
|
||||
length = read16() - 2;
|
||||
scanInfo.numComps = str->getChar();
|
||||
+ if (scanInfo.numComps <= 0 || scanInfo.numComps > 4) {
|
||||
+ error(getPos(), "Bad number of components in DCT stream");
|
||||
+ scanInfo.numComps = 0;
|
||||
+ return gFalse;
|
||||
+ }
|
||||
--length;
|
||||
if (length != 2 * scanInfo.numComps + 3) {
|
||||
error(getPos(), "Bad DCT scan info block");
|
||||
***************
|
||||
*** 3041,3046 ****
|
||||
--- 3077,3083 ----
|
||||
numACHuffTables = index+1;
|
||||
tbl = &acHuffTables[index];
|
||||
} else {
|
||||
+ index &= 0x0f;
|
||||
if (index >= numDCHuffTables)
|
||||
numDCHuffTables = index+1;
|
||||
tbl = &dcHuffTables[index];
|
||||
***************
|
||||
*** 3827,3832 ****
|
||||
--- 3864,3873 ----
|
||||
FilterStream(strA) {
|
||||
if (predictor != 1) {
|
||||
pred = new StreamPredictor(this, predictor, columns, colors, bits);
|
||||
+ if (!pred->isOk()) {
|
||||
+ delete pred;
|
||||
+ pred = NULL;
|
||||
+ }
|
||||
} else {
|
||||
pred = NULL;
|
||||
}
|
||||
diff -cr xpdf-3.01.orig/xpdf/Stream.h xpdf-3.01/xpdf/Stream.h
|
||||
*** xpdf-3.01.orig/xpdf/Stream.h Tue Aug 16 22:34:31 2005
|
||||
--- xpdf-3.01/xpdf/Stream.h Tue Jan 17 17:19:54 2006
|
||||
***************
|
||||
*** 232,237 ****
|
||||
--- 232,239 ----
|
||||
|
||||
~StreamPredictor();
|
||||
|
||||
+ GBool isOk() { return ok; }
|
||||
+
|
||||
int lookChar();
|
||||
int getChar();
|
||||
|
||||
***************
|
||||
*** 249,254 ****
|
||||
--- 251,257 ----
|
||||
int rowBytes; // bytes per line
|
||||
Guchar *predLine; // line buffer
|
||||
int predIdx; // current index in predLine
|
||||
+ GBool ok;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
***************
|
||||
*** 527,533 ****
|
||||
short getWhiteCode();
|
||||
short getBlackCode();
|
||||
short lookBits(int n);
|
||||
! void eatBits(int n) { inputBits -= n; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
--- 530,536 ----
|
||||
short getWhiteCode();
|
||||
short getBlackCode();
|
||||
short lookBits(int n);
|
||||
! void eatBits(int n) { if ((inputBits -= n) < 0) inputBits = 0; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
diff -cr xpdf-3.01.orig/splash/SplashXPathScanner.cc xpdf-3.01/splash/SplashXPathScanner.cc
|
||||
*** xpdf-3.01.orig/splash/SplashXPathScanner.cc Tue Aug 16 22:34:31 2005
|
||||
--- xpdf-3.01/splash/SplashXPathScanner.cc Wed Feb 1 17:01:14 2006
|
||||
***************
|
||||
*** 186,192 ****
|
||||
}
|
||||
|
||||
void SplashXPathScanner::computeIntersections(int y) {
|
||||
! SplashCoord ySegMin, ySegMax, xx0, xx1;
|
||||
SplashXPathSeg *seg;
|
||||
int i, j;
|
||||
|
||||
--- 186,192 ----
|
||||
}
|
||||
|
||||
void SplashXPathScanner::computeIntersections(int y) {
|
||||
! SplashCoord xSegMin, xSegMax, ySegMin, ySegMax, xx0, xx1;
|
||||
SplashXPathSeg *seg;
|
||||
int i, j;
|
||||
|
||||
***************
|
||||
*** 236,254 ****
|
||||
} else if (seg->flags & splashXPathVert) {
|
||||
xx0 = xx1 = seg->x0;
|
||||
} else {
|
||||
! if (ySegMin <= y) {
|
||||
! // intersection with top edge
|
||||
! xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy;
|
||||
} else {
|
||||
! // x coord of segment endpoint with min y coord
|
||||
! xx0 = (seg->flags & splashXPathFlip) ? seg->x1 : seg->x0;
|
||||
}
|
||||
! if (ySegMax >= y + 1) {
|
||||
! // intersection with bottom edge
|
||||
! xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy;
|
||||
! } else {
|
||||
! // x coord of segment endpoint with max y coord
|
||||
! xx1 = (seg->flags & splashXPathFlip) ? seg->x0 : seg->x1;
|
||||
}
|
||||
}
|
||||
if (xx0 < xx1) {
|
||||
--- 236,262 ----
|
||||
} else if (seg->flags & splashXPathVert) {
|
||||
xx0 = xx1 = seg->x0;
|
||||
} else {
|
||||
! if (seg->x0 < seg->x1) {
|
||||
! xSegMin = seg->x0;
|
||||
! xSegMax = seg->x1;
|
||||
} else {
|
||||
! xSegMin = seg->x1;
|
||||
! xSegMax = seg->x0;
|
||||
}
|
||||
! // intersection with top edge
|
||||
! xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy;
|
||||
! // intersection with bottom edge
|
||||
! xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy;
|
||||
! // the segment may not actually extend to the top and/or bottom edges
|
||||
! if (xx0 < xSegMin) {
|
||||
! xx0 = xSegMin;
|
||||
! } else if (xx0 > xSegMax) {
|
||||
! xx0 = xSegMax;
|
||||
! }
|
||||
! if (xx1 < xSegMin) {
|
||||
! xx1 = xSegMin;
|
||||
! } else if (xx1 > xSegMax) {
|
||||
! xx1 = xSegMax;
|
||||
}
|
||||
}
|
||||
if (xx0 < xx1) {
|
||||
26
xpdf-3.02-additionalzoom.patch
Normal file
26
xpdf-3.02-additionalzoom.patch
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
diff -up xpdf-3.02/xpdf/XPDFViewer.cc.BAD xpdf-3.02/xpdf/XPDFViewer.cc
|
||||
--- xpdf-3.02/xpdf/XPDFViewer.cc.BAD 2007-08-28 14:44:09.000000000 -0400
|
||||
+++ xpdf-3.02/xpdf/XPDFViewer.cc 2007-08-28 14:44:47.000000000 -0400
|
||||
@@ -140,6 +140,8 @@ struct ZoomMenuInfo {
|
||||
|
||||
static ZoomMenuInfo zoomMenuInfo[nZoomMenuItems] = {
|
||||
{ "400%", 400 },
|
||||
+ { "300%", 300 },
|
||||
+ { "250%", 250 },
|
||||
{ "200%", 200 },
|
||||
{ "150%", 150 },
|
||||
{ "125%", 125 },
|
||||
diff -up xpdf-3.02/xpdf/Stream.cc.BAD xpdf-3.02/xpdf/Stream.cc
|
||||
diff -up xpdf-3.02/xpdf/XPDFViewer.h.BAD xpdf-3.02/xpdf/XPDFViewer.h
|
||||
diff -up xpdf-3.02/xpdf/XPDFViewer.h.BAD xpdf-3.02/xpdf/XPDFViewer.h
|
||||
--- xpdf-3.02/xpdf/XPDFViewer.h.BAD 2007-08-28 16:46:48.000000000 -0400
|
||||
+++ xpdf-3.02/xpdf/XPDFViewer.h 2007-08-28 16:46:57.000000000 -0400
|
||||
@@ -41,7 +41,7 @@ class XPDFViewer;
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
// NB: this must match the defn of zoomMenuBtnInfo in XPDFViewer.cc
|
||||
-#define nZoomMenuItems 10
|
||||
+#define nZoomMenuItems 12
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
48
xpdf-3.02-crash.patch
Normal file
48
xpdf-3.02-crash.patch
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
diff -up xpdf-3.02/fofi/FoFiType1.cc.crash xpdf-3.02/fofi/FoFiType1.cc
|
||||
--- xpdf-3.02/fofi/FoFiType1.cc.crash 2007-02-27 17:05:51.000000000 -0500
|
||||
+++ xpdf-3.02/fofi/FoFiType1.cc 2009-02-11 11:31:04.000000000 -0500
|
||||
@@ -235,9 +235,14 @@ void FoFiType1::parse() {
|
||||
}
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
diff -up xpdf-3.02/splash/Splash.cc.crash xpdf-3.02/splash/Splash.cc
|
||||
--- xpdf-3.02/splash/Splash.cc.crash 2007-02-27 17:05:52.000000000 -0500
|
||||
+++ xpdf-3.02/splash/Splash.cc 2009-02-11 11:34:45.000000000 -0500
|
||||
@@ -1501,6 +1501,11 @@ SplashError Splash::fillWithPattern(Spla
|
||||
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
|
||||
@@ -1573,6 +1578,11 @@ SplashError Splash::xorFill(SplashPath *
|
||||
}
|
||||
xPath = new SplashXPath(path, state->matrix, state->flatness, gTrue);
|
||||
xPath->sort();
|
||||
+ if (!&xPath->segs[0])
|
||||
+ {
|
||||
+ delete xPath;
|
||||
+ return splashErrEmptyPath;
|
||||
+ }
|
||||
scanner = new SplashXPathScanner(xPath, eo);
|
||||
|
||||
// get the min and max x and y values
|
||||
32
xpdf-3.02-fontlist.patch
Normal file
32
xpdf-3.02-fontlist.patch
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
--- xpdf-3.02/xpdf/XPDFApp.cc.fntlist 2007-02-27 15:05:52.000000000 -0700
|
||||
+++ xpdf-3.02/xpdf/XPDFApp.cc 2007-08-02 20:39:26.000000000 -0600
|
||||
@@ -35,9 +35,9 @@
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
static String fallbackResources[] = {
|
||||
- "*.zoomComboBox*fontList: -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1",
|
||||
- "*XmTextField.fontList: -*-courier-medium-r-normal--12-*-*-*-*-*-iso8859-1",
|
||||
- "*.fontList: -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1",
|
||||
+ "*.zoomComboBox*fontList: -*-helvetica-medium-r-normal-*-12-*-*-*-*-*-iso8859-1",
|
||||
+ "*XmTextField.fontList: -*-courier-medium-r-*-12-*-*-*-*-*-iso8859-1",
|
||||
+ "*.fontList: -*-helvetica-medium-r-normal-*-12-*-*-*-*-*-iso8859-1",
|
||||
"*XmTextField.translations: #override\\n"
|
||||
" Ctrl<Key>a:beginning-of-line()\\n"
|
||||
" Ctrl<Key>b:backward-character()\\n"
|
||||
--- xpdf-3.02/xpdf/XPDFViewer.cc.fntlist 2007-08-02 20:25:21.000000000 -0600
|
||||
+++ xpdf-3.02/xpdf/XPDFViewer.cc 2007-08-02 20:38:03.000000000 -0600
|
||||
@@ -2789,11 +2789,11 @@ void XPDFViewer::initAboutDialog() {
|
||||
|
||||
//----- fonts
|
||||
aboutBigFont =
|
||||
- createFontList("-*-times-bold-i-normal--20-*-*-*-*-*-iso8859-1");
|
||||
+ createFontList("-*-times-bold-i-normal-*-20-*-*-*-*-*-iso8859-1");
|
||||
aboutVersionFont =
|
||||
- createFontList("-*-times-medium-r-normal--14-*-*-*-*-*-iso8859-1");
|
||||
+ createFontList("-*-times-medium-r-normal-*-14-*-*-*-*-*-iso8859-1");
|
||||
aboutFixedFont =
|
||||
- createFontList("-*-courier-medium-r-normal--12-*-*-*-*-*-iso8859-1");
|
||||
+ createFontList("-*-courier-medium-r-*-12-*-*-*-*-*-iso8859-1");
|
||||
|
||||
//----- heading
|
||||
n = 0;
|
||||
51
xpdf-3.02-mousebuttons.patch
Normal file
51
xpdf-3.02-mousebuttons.patch
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
diff -up xpdf-3.02/xpdf/GlobalParams.cc.BAD xpdf-3.02/xpdf/GlobalParams.cc
|
||||
--- xpdf-3.02/xpdf/GlobalParams.cc.BAD 2007-08-28 14:30:13.000000000 -0400
|
||||
+++ xpdf-3.02/xpdf/GlobalParams.cc 2007-08-28 14:30:38.000000000 -0400
|
||||
@@ -1574,10 +1574,10 @@ GBool GlobalParams::parseKey(GString *mo
|
||||
!p0[3]) {
|
||||
*code = xpdfKeyCodeF1 + 10 * (p0[1] - '0') + (p0[2] - '0') - 1;
|
||||
} else if (!strncmp(p0, "mousePress", 10) &&
|
||||
- p0[10] >= '1' && p0[10] <= '7' && !p0[11]) {
|
||||
+ p0[10] >= '1' && p0[10] <= '9' && !p0[11]) {
|
||||
*code = xpdfKeyCodeMousePress1 + (p0[10] - '1');
|
||||
} else if (!strncmp(p0, "mouseRelease", 12) &&
|
||||
- p0[12] >= '1' && p0[12] <= '7' && !p0[13]) {
|
||||
+ p0[12] >= '1' && p0[12] <= '9' && !p0[13]) {
|
||||
*code = xpdfKeyCodeMouseRelease1 + (p0[12] - '1');
|
||||
} else if (*p0 >= 0x20 && *p0 <= 0x7e && !p0[1]) {
|
||||
*code = (int)*p0;
|
||||
diff -up xpdf-3.02/xpdf/GlobalParams.h.BAD xpdf-3.02/xpdf/GlobalParams.h
|
||||
--- xpdf-3.02/xpdf/GlobalParams.h.BAD 2007-08-28 14:30:44.000000000 -0400
|
||||
+++ xpdf-3.02/xpdf/GlobalParams.h 2007-08-28 14:31:12.000000000 -0400
|
||||
@@ -164,6 +164,8 @@ public:
|
||||
#define xpdfKeyCodeMousePress5 0x2005
|
||||
#define xpdfKeyCodeMousePress6 0x2006
|
||||
#define xpdfKeyCodeMousePress7 0x2007
|
||||
+#define xpdfKeyCodeMousePress8 0x2008
|
||||
+#define xpdfKeyCodeMousePress9 0x2009
|
||||
#define xpdfKeyCodeMouseRelease1 0x2101
|
||||
#define xpdfKeyCodeMouseRelease2 0x2102
|
||||
#define xpdfKeyCodeMouseRelease3 0x2103
|
||||
@@ -171,6 +173,8 @@ public:
|
||||
#define xpdfKeyCodeMouseRelease5 0x2105
|
||||
#define xpdfKeyCodeMouseRelease6 0x2106
|
||||
#define xpdfKeyCodeMouseRelease7 0x2107
|
||||
+#define xpdfKeyCodeMouseRelease8 0x2108
|
||||
+#define xpdfKeyCodeMouseRelease9 0x2109
|
||||
#define xpdfKeyModNone 0
|
||||
#define xpdfKeyModShift (1 << 0)
|
||||
#define xpdfKeyModCtrl (1 << 1)
|
||||
diff -up xpdf-3.02/doc/xpdfrc.5.BAD xpdf-3.02/doc/xpdfrc.5
|
||||
--- xpdf-3.02/doc/xpdfrc.5.BAD 2007-08-28 14:31:25.000000000 -0400
|
||||
+++ xpdf-3.02/doc/xpdfrc.5 2007-08-28 14:31:35.000000000 -0400
|
||||
@@ -483,8 +483,8 @@ can be a regular ASCII character, or any
|
||||
pgdn
|
||||
left / right / up / down (arrow keys)
|
||||
f1 .. f35 (function keys)
|
||||
- mousePress1 .. mousePress7 (mouse buttons)
|
||||
- mouseRelease1 .. mouseRelease7 (mouse buttons)
|
||||
+ mousePress1 .. mousePress9 (mouse buttons)
|
||||
+ mouseRelease1 .. mouseRelease9 (mouse buttons)
|
||||
|
||||
.fi
|
||||
.I Context
|
||||
18
xpdf-3.02-mousebuttons_view.patch
Normal file
18
xpdf-3.02-mousebuttons_view.patch
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
--- xpdf-3.02/xpdf/XPDFViewer.cc~ 2009-02-02 01:58:55.000000000 -0700
|
||||
+++ xpdf-3.02/xpdf/XPDFViewer.cc 2009-02-02 02:27:04.000000000 -0700
|
||||
@@ -592,13 +592,13 @@ void XPDFViewer::mouseCbk(void *data, XE
|
||||
int i;
|
||||
|
||||
if (event->type == ButtonPress) {
|
||||
- if (event->xbutton.button >= 1 && event->xbutton.button <= 7) {
|
||||
+ if (event->xbutton.button >= 1 && event->xbutton.button <= 9) {
|
||||
keyCode = xpdfKeyCodeMousePress1 + event->xbutton.button - 1;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} else if (event->type == ButtonRelease) {
|
||||
- if (event->xbutton.button >= 1 && event->xbutton.button <= 7) {
|
||||
+ if (event->xbutton.button >= 1 && event->xbutton.button <= 9) {
|
||||
keyCode = xpdfKeyCodeMouseRelease1 + event->xbutton.button - 1;
|
||||
} else {
|
||||
return;
|
||||
12
xpdf-3.02-x86_64-fix.patch
Normal file
12
xpdf-3.02-x86_64-fix.patch
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
diff -up xpdf-3.02/xpdf/Stream.cc.BAD xpdf-3.02/xpdf/Stream.cc
|
||||
--- xpdf-3.02/xpdf/Stream.cc.BAD 2007-08-21 16:20:40.000000000 -0400
|
||||
+++ xpdf-3.02/xpdf/Stream.cc 2007-08-21 16:20:44.000000000 -0400
|
||||
@@ -4451,7 +4451,7 @@ void ASCII85Encoder::reset() {
|
||||
}
|
||||
|
||||
GBool ASCII85Encoder::fillBuf() {
|
||||
- Gulong t;
|
||||
+ Guint t;
|
||||
char buf1[5];
|
||||
int c0, c1, c2, c3;
|
||||
int n, i;
|
||||
33
xpdf-3.02pl1.patch
Normal file
33
xpdf-3.02pl1.patch
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
*** xpdf-3.02.orig/xpdf/Stream.cc Tue Feb 27 14:05:52 2007
|
||||
--- xpdf-3.02/xpdf/Stream.cc Thu Jul 26 14:44:43 2007
|
||||
***************
|
||||
*** 410,424 ****
|
||||
ok = gFalse;
|
||||
|
||||
nVals = width * nComps;
|
||||
- if (width <= 0 || nComps <= 0 || nBits <= 0 ||
|
||||
- nComps >= INT_MAX / nBits ||
|
||||
- width >= INT_MAX / nComps / nBits ||
|
||||
- nVals * nBits + 7 < 0) {
|
||||
- return;
|
||||
- }
|
||||
pixBytes = (nComps * nBits + 7) >> 3;
|
||||
rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
|
||||
! if (rowBytes <= 0) {
|
||||
return;
|
||||
}
|
||||
predLine = (Guchar *)gmalloc(rowBytes);
|
||||
--- 410,422 ----
|
||||
ok = gFalse;
|
||||
|
||||
nVals = width * nComps;
|
||||
pixBytes = (nComps * nBits + 7) >> 3;
|
||||
rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
|
||||
! if (width <= 0 || nComps <= 0 || nBits <= 0 ||
|
||||
! nComps > gfxColorMaxComps ||
|
||||
! nBits > 16 ||
|
||||
! width >= INT_MAX / nComps || // check for overflow in nVals
|
||||
! nVals >= (INT_MAX - 7) / nBits) { // check for overflow in rowBytes
|
||||
return;
|
||||
}
|
||||
predLine = (Guchar *)gmalloc(rowBytes);
|
||||
823
xpdf-3.02pl2.patch
Normal file
823
xpdf-3.02pl2.patch
Normal file
|
|
@ -0,0 +1,823 @@
|
|||
diff -c -r xpdf-3.02pl1.orig/xpdf/Stream.cc xpdf-3.02/xpdf/Stream.cc
|
||||
*** xpdf-3.02pl1.orig/xpdf/Stream.cc Thu Oct 25 15:47:38 2007
|
||||
--- xpdf-3.02/xpdf/Stream.cc Thu Oct 25 15:48:19 2007
|
||||
***************
|
||||
*** 1243,1265 ****
|
||||
columns = columnsA;
|
||||
if (columns < 1) {
|
||||
columns = 1;
|
||||
! }
|
||||
! if (columns + 4 <= 0) {
|
||||
! columns = INT_MAX - 4;
|
||||
}
|
||||
rows = rowsA;
|
||||
endOfBlock = endOfBlockA;
|
||||
black = blackA;
|
||||
! refLine = (short *)gmallocn(columns + 3, sizeof(short));
|
||||
! codingLine = (short *)gmallocn(columns + 2, sizeof(short));
|
||||
|
||||
eof = gFalse;
|
||||
row = 0;
|
||||
nextLine2D = encoding < 0;
|
||||
inputBits = 0;
|
||||
! codingLine[0] = 0;
|
||||
! codingLine[1] = refLine[2] = columns;
|
||||
! a0 = 1;
|
||||
|
||||
buf = EOF;
|
||||
}
|
||||
--- 1243,1268 ----
|
||||
columns = columnsA;
|
||||
if (columns < 1) {
|
||||
columns = 1;
|
||||
! } else if (columns > INT_MAX - 2) {
|
||||
! columns = INT_MAX - 2;
|
||||
}
|
||||
rows = rowsA;
|
||||
endOfBlock = endOfBlockA;
|
||||
black = blackA;
|
||||
! // 0 <= codingLine[0] < codingLine[1] < ... < codingLine[n] = columns
|
||||
! // ---> max codingLine size = columns + 1
|
||||
! // refLine has one extra guard entry at the end
|
||||
! // ---> max refLine size = columns + 2
|
||||
! codingLine = (int *)gmallocn(columns + 1, sizeof(int));
|
||||
! refLine = (int *)gmallocn(columns + 2, sizeof(int));
|
||||
|
||||
eof = gFalse;
|
||||
row = 0;
|
||||
nextLine2D = encoding < 0;
|
||||
inputBits = 0;
|
||||
! codingLine[0] = columns;
|
||||
! a0i = 0;
|
||||
! outputBits = 0;
|
||||
|
||||
buf = EOF;
|
||||
}
|
||||
***************
|
||||
*** 1278,1286 ****
|
||||
row = 0;
|
||||
nextLine2D = encoding < 0;
|
||||
inputBits = 0;
|
||||
! codingLine[0] = 0;
|
||||
! codingLine[1] = columns;
|
||||
! a0 = 1;
|
||||
buf = EOF;
|
||||
|
||||
// skip any initial zero bits and end-of-line marker, and get the 2D
|
||||
--- 1281,1289 ----
|
||||
row = 0;
|
||||
nextLine2D = encoding < 0;
|
||||
inputBits = 0;
|
||||
! codingLine[0] = columns;
|
||||
! a0i = 0;
|
||||
! outputBits = 0;
|
||||
buf = EOF;
|
||||
|
||||
// skip any initial zero bits and end-of-line marker, and get the 2D
|
||||
***************
|
||||
*** 1297,1507 ****
|
||||
}
|
||||
}
|
||||
|
||||
int CCITTFaxStream::lookChar() {
|
||||
short code1, code2, code3;
|
||||
! int a0New;
|
||||
! GBool err, gotEOL;
|
||||
! int ret;
|
||||
! int bits, i;
|
||||
|
||||
! // if at eof just return EOF
|
||||
! if (eof && codingLine[a0] >= columns) {
|
||||
! return EOF;
|
||||
}
|
||||
|
||||
// read the next row
|
||||
! err = gFalse;
|
||||
! if (codingLine[a0] >= columns) {
|
||||
|
||||
// 2-D encoding
|
||||
if (nextLine2D) {
|
||||
- // state:
|
||||
- // a0New = current position in coding line (0 <= a0New <= columns)
|
||||
- // codingLine[a0] = last change in coding line
|
||||
- // (black-to-white if a0 is even,
|
||||
- // white-to-black if a0 is odd)
|
||||
- // refLine[b1] = next change in reference line of opposite color
|
||||
- // to a0
|
||||
- // invariants:
|
||||
- // 0 <= codingLine[a0] <= a0New
|
||||
- // <= refLine[b1] <= refLine[b1+1] <= columns
|
||||
- // 0 <= a0 <= columns+1
|
||||
- // refLine[0] = 0
|
||||
- // refLine[n] = refLine[n+1] = columns
|
||||
- // -- for some 1 <= n <= columns+1
|
||||
- // end condition:
|
||||
- // 0 = codingLine[0] <= codingLine[1] < codingLine[2] < ...
|
||||
- // < codingLine[n-1] < codingLine[n] = columns
|
||||
- // -- where 1 <= n <= columns+1
|
||||
for (i = 0; codingLine[i] < columns; ++i) {
|
||||
refLine[i] = codingLine[i];
|
||||
}
|
||||
! refLine[i] = refLine[i + 1] = columns;
|
||||
! b1 = 1;
|
||||
! a0New = codingLine[a0 = 0] = 0;
|
||||
! do {
|
||||
code1 = getTwoDimCode();
|
||||
switch (code1) {
|
||||
case twoDimPass:
|
||||
! if (refLine[b1] < columns) {
|
||||
! a0New = refLine[b1 + 1];
|
||||
! b1 += 2;
|
||||
}
|
||||
break;
|
||||
case twoDimHoriz:
|
||||
! if ((a0 & 1) == 0) {
|
||||
! code1 = code2 = 0;
|
||||
do {
|
||||
! code1 += code3 = getWhiteCode();
|
||||
} while (code3 >= 64);
|
||||
do {
|
||||
! code2 += code3 = getBlackCode();
|
||||
} while (code3 >= 64);
|
||||
} else {
|
||||
- code1 = code2 = 0;
|
||||
do {
|
||||
! code1 += code3 = getBlackCode();
|
||||
} while (code3 >= 64);
|
||||
do {
|
||||
! code2 += code3 = getWhiteCode();
|
||||
} while (code3 >= 64);
|
||||
}
|
||||
! if (code1 > 0 || code2 > 0) {
|
||||
! if (a0New + code1 <= columns) {
|
||||
! codingLine[a0 + 1] = a0New + code1;
|
||||
! } else {
|
||||
! codingLine[a0 + 1] = columns;
|
||||
! }
|
||||
! ++a0;
|
||||
! if (codingLine[a0] + code2 <= columns) {
|
||||
! codingLine[a0 + 1] = codingLine[a0] + code2;
|
||||
! } else {
|
||||
! codingLine[a0 + 1] = columns;
|
||||
! }
|
||||
! ++a0;
|
||||
! a0New = codingLine[a0];
|
||||
! while (refLine[b1] <= a0New && refLine[b1] < columns) {
|
||||
! b1 += 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
! case twoDimVert0:
|
||||
! if (refLine[b1] < columns) {
|
||||
! a0New = codingLine[++a0] = refLine[b1];
|
||||
! ++b1;
|
||||
! while (refLine[b1] <= a0New && refLine[b1] < columns) {
|
||||
! b1 += 2;
|
||||
}
|
||||
- } else {
|
||||
- a0New = codingLine[++a0] = columns;
|
||||
}
|
||||
break;
|
||||
case twoDimVertR1:
|
||||
! if (refLine[b1] + 1 < columns) {
|
||||
! a0New = codingLine[++a0] = refLine[b1] + 1;
|
||||
! ++b1;
|
||||
! while (refLine[b1] <= a0New && refLine[b1] < columns) {
|
||||
! b1 += 2;
|
||||
}
|
||||
- } else {
|
||||
- a0New = codingLine[++a0] = columns;
|
||||
}
|
||||
break;
|
||||
! case twoDimVertL1:
|
||||
! if (refLine[b1] - 1 > a0New || (a0 == 0 && refLine[b1] == 1)) {
|
||||
! a0New = codingLine[++a0] = refLine[b1] - 1;
|
||||
! --b1;
|
||||
! while (refLine[b1] <= a0New && refLine[b1] < columns) {
|
||||
! b1 += 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
! case twoDimVertR2:
|
||||
! if (refLine[b1] + 2 < columns) {
|
||||
! a0New = codingLine[++a0] = refLine[b1] + 2;
|
||||
! ++b1;
|
||||
! while (refLine[b1] <= a0New && refLine[b1] < columns) {
|
||||
! b1 += 2;
|
||||
}
|
||||
- } else {
|
||||
- a0New = codingLine[++a0] = columns;
|
||||
}
|
||||
break;
|
||||
case twoDimVertL2:
|
||||
! if (refLine[b1] - 2 > a0New || (a0 == 0 && refLine[b1] == 2)) {
|
||||
! a0New = codingLine[++a0] = refLine[b1] - 2;
|
||||
! --b1;
|
||||
! while (refLine[b1] <= a0New && refLine[b1] < columns) {
|
||||
! b1 += 2;
|
||||
}
|
||||
! }
|
||||
! break;
|
||||
! case twoDimVertR3:
|
||||
! if (refLine[b1] + 3 < columns) {
|
||||
! a0New = codingLine[++a0] = refLine[b1] + 3;
|
||||
! ++b1;
|
||||
! while (refLine[b1] <= a0New && refLine[b1] < columns) {
|
||||
! b1 += 2;
|
||||
}
|
||||
- } else {
|
||||
- a0New = codingLine[++a0] = columns;
|
||||
}
|
||||
break;
|
||||
! case twoDimVertL3:
|
||||
! if (refLine[b1] - 3 > a0New || (a0 == 0 && refLine[b1] == 3)) {
|
||||
! a0New = codingLine[++a0] = refLine[b1] - 3;
|
||||
! --b1;
|
||||
! while (refLine[b1] <= a0New && refLine[b1] < columns) {
|
||||
! b1 += 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EOF:
|
||||
eof = gTrue;
|
||||
! codingLine[a0 = 0] = columns;
|
||||
! return EOF;
|
||||
default:
|
||||
error(getPos(), "Bad 2D code %04x in CCITTFax stream", code1);
|
||||
err = gTrue;
|
||||
break;
|
||||
}
|
||||
! } while (codingLine[a0] < columns);
|
||||
|
||||
// 1-D encoding
|
||||
} else {
|
||||
! codingLine[a0 = 0] = 0;
|
||||
! while (1) {
|
||||
code1 = 0;
|
||||
! do {
|
||||
! code1 += code3 = getWhiteCode();
|
||||
! } while (code3 >= 64);
|
||||
! codingLine[a0+1] = codingLine[a0] + code1;
|
||||
! ++a0;
|
||||
! if (codingLine[a0] >= columns) {
|
||||
! break;
|
||||
! }
|
||||
! code2 = 0;
|
||||
! do {
|
||||
! code2 += code3 = getBlackCode();
|
||||
! } while (code3 >= 64);
|
||||
! codingLine[a0+1] = codingLine[a0] + code2;
|
||||
! ++a0;
|
||||
! if (codingLine[a0] >= columns) {
|
||||
! break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- if (codingLine[a0] != columns) {
|
||||
- error(getPos(), "CCITTFax row is wrong length (%d)", codingLine[a0]);
|
||||
- // force the row to be the correct length
|
||||
- while (codingLine[a0] > columns) {
|
||||
- --a0;
|
||||
- }
|
||||
- codingLine[++a0] = columns;
|
||||
- err = gTrue;
|
||||
- }
|
||||
-
|
||||
// byte-align the row
|
||||
if (byteAlign) {
|
||||
inputBits &= ~7;
|
||||
--- 1300,1529 ----
|
||||
}
|
||||
}
|
||||
|
||||
+ inline void CCITTFaxStream::addPixels(int a1, int blackPixels) {
|
||||
+ if (a1 > codingLine[a0i]) {
|
||||
+ if (a1 > columns) {
|
||||
+ error(getPos(), "CCITTFax row is wrong length (%d)", a1);
|
||||
+ err = gTrue;
|
||||
+ a1 = columns;
|
||||
+ }
|
||||
+ if ((a0i & 1) ^ blackPixels) {
|
||||
+ ++a0i;
|
||||
+ }
|
||||
+ codingLine[a0i] = a1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ inline void CCITTFaxStream::addPixelsNeg(int a1, int blackPixels) {
|
||||
+ if (a1 > codingLine[a0i]) {
|
||||
+ if (a1 > columns) {
|
||||
+ error(getPos(), "CCITTFax row is wrong length (%d)", a1);
|
||||
+ err = gTrue;
|
||||
+ a1 = columns;
|
||||
+ }
|
||||
+ if ((a0i & 1) ^ blackPixels) {
|
||||
+ ++a0i;
|
||||
+ }
|
||||
+ codingLine[a0i] = a1;
|
||||
+ } else if (a1 < codingLine[a0i]) {
|
||||
+ if (a1 < 0) {
|
||||
+ error(getPos(), "Invalid CCITTFax code");
|
||||
+ err = gTrue;
|
||||
+ a1 = 0;
|
||||
+ }
|
||||
+ while (a0i > 0 && a1 <= codingLine[a0i - 1]) {
|
||||
+ --a0i;
|
||||
+ }
|
||||
+ codingLine[a0i] = a1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
int CCITTFaxStream::lookChar() {
|
||||
short code1, code2, code3;
|
||||
! int b1i, blackPixels, i, bits;
|
||||
! GBool gotEOL;
|
||||
|
||||
! if (buf != EOF) {
|
||||
! return buf;
|
||||
}
|
||||
|
||||
// read the next row
|
||||
! if (outputBits == 0) {
|
||||
!
|
||||
! // if at eof just return EOF
|
||||
! if (eof) {
|
||||
! return EOF;
|
||||
! }
|
||||
!
|
||||
! err = gFalse;
|
||||
|
||||
// 2-D encoding
|
||||
if (nextLine2D) {
|
||||
for (i = 0; codingLine[i] < columns; ++i) {
|
||||
refLine[i] = codingLine[i];
|
||||
}
|
||||
! refLine[i++] = columns;
|
||||
! refLine[i] = columns;
|
||||
! codingLine[0] = 0;
|
||||
! a0i = 0;
|
||||
! b1i = 0;
|
||||
! blackPixels = 0;
|
||||
! // invariant:
|
||||
! // refLine[b1i-1] <= codingLine[a0i] < refLine[b1i] < refLine[b1i+1]
|
||||
! // <= columns
|
||||
! // exception at left edge:
|
||||
! // codingLine[a0i = 0] = refLine[b1i = 0] = 0 is possible
|
||||
! // exception at right edge:
|
||||
! // refLine[b1i] = refLine[b1i+1] = columns is possible
|
||||
! while (codingLine[a0i] < columns) {
|
||||
code1 = getTwoDimCode();
|
||||
switch (code1) {
|
||||
case twoDimPass:
|
||||
! addPixels(refLine[b1i + 1], blackPixels);
|
||||
! if (refLine[b1i + 1] < columns) {
|
||||
! b1i += 2;
|
||||
}
|
||||
break;
|
||||
case twoDimHoriz:
|
||||
! code1 = code2 = 0;
|
||||
! if (blackPixels) {
|
||||
do {
|
||||
! code1 += code3 = getBlackCode();
|
||||
} while (code3 >= 64);
|
||||
do {
|
||||
! code2 += code3 = getWhiteCode();
|
||||
} while (code3 >= 64);
|
||||
} else {
|
||||
do {
|
||||
! code1 += code3 = getWhiteCode();
|
||||
} while (code3 >= 64);
|
||||
do {
|
||||
! code2 += code3 = getBlackCode();
|
||||
} while (code3 >= 64);
|
||||
}
|
||||
! addPixels(codingLine[a0i] + code1, blackPixels);
|
||||
! if (codingLine[a0i] < columns) {
|
||||
! addPixels(codingLine[a0i] + code2, blackPixels ^ 1);
|
||||
! }
|
||||
! while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
|
||||
! b1i += 2;
|
||||
! }
|
||||
! break;
|
||||
! case twoDimVertR3:
|
||||
! addPixels(refLine[b1i] + 3, blackPixels);
|
||||
! blackPixels ^= 1;
|
||||
! if (codingLine[a0i] < columns) {
|
||||
! ++b1i;
|
||||
! while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
|
||||
! b1i += 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
! case twoDimVertR2:
|
||||
! addPixels(refLine[b1i] + 2, blackPixels);
|
||||
! blackPixels ^= 1;
|
||||
! if (codingLine[a0i] < columns) {
|
||||
! ++b1i;
|
||||
! while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
|
||||
! b1i += 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case twoDimVertR1:
|
||||
! addPixels(refLine[b1i] + 1, blackPixels);
|
||||
! blackPixels ^= 1;
|
||||
! if (codingLine[a0i] < columns) {
|
||||
! ++b1i;
|
||||
! while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
|
||||
! b1i += 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
! case twoDimVert0:
|
||||
! addPixels(refLine[b1i], blackPixels);
|
||||
! blackPixels ^= 1;
|
||||
! if (codingLine[a0i] < columns) {
|
||||
! ++b1i;
|
||||
! while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
|
||||
! b1i += 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
! case twoDimVertL3:
|
||||
! addPixelsNeg(refLine[b1i] - 3, blackPixels);
|
||||
! blackPixels ^= 1;
|
||||
! if (codingLine[a0i] < columns) {
|
||||
! if (b1i > 0) {
|
||||
! --b1i;
|
||||
! } else {
|
||||
! ++b1i;
|
||||
! }
|
||||
! while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
|
||||
! b1i += 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case twoDimVertL2:
|
||||
! addPixelsNeg(refLine[b1i] - 2, blackPixels);
|
||||
! blackPixels ^= 1;
|
||||
! if (codingLine[a0i] < columns) {
|
||||
! if (b1i > 0) {
|
||||
! --b1i;
|
||||
! } else {
|
||||
! ++b1i;
|
||||
}
|
||||
! while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
|
||||
! b1i += 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
! case twoDimVertL1:
|
||||
! addPixelsNeg(refLine[b1i] - 1, blackPixels);
|
||||
! blackPixels ^= 1;
|
||||
! if (codingLine[a0i] < columns) {
|
||||
! if (b1i > 0) {
|
||||
! --b1i;
|
||||
! } else {
|
||||
! ++b1i;
|
||||
! }
|
||||
! while (refLine[b1i] <= codingLine[a0i] && refLine[b1i] < columns) {
|
||||
! b1i += 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EOF:
|
||||
+ addPixels(columns, 0);
|
||||
eof = gTrue;
|
||||
! break;
|
||||
default:
|
||||
error(getPos(), "Bad 2D code %04x in CCITTFax stream", code1);
|
||||
+ addPixels(columns, 0);
|
||||
err = gTrue;
|
||||
break;
|
||||
}
|
||||
! }
|
||||
|
||||
// 1-D encoding
|
||||
} else {
|
||||
! codingLine[0] = 0;
|
||||
! a0i = 0;
|
||||
! blackPixels = 0;
|
||||
! while (codingLine[a0i] < columns) {
|
||||
code1 = 0;
|
||||
! if (blackPixels) {
|
||||
! do {
|
||||
! code1 += code3 = getBlackCode();
|
||||
! } while (code3 >= 64);
|
||||
! } else {
|
||||
! do {
|
||||
! code1 += code3 = getWhiteCode();
|
||||
! } while (code3 >= 64);
|
||||
}
|
||||
+ addPixels(codingLine[a0i] + code1, blackPixels);
|
||||
+ blackPixels ^= 1;
|
||||
}
|
||||
}
|
||||
|
||||
// byte-align the row
|
||||
if (byteAlign) {
|
||||
inputBits &= ~7;
|
||||
***************
|
||||
*** 1560,1573 ****
|
||||
// this if we know the stream contains end-of-line markers because
|
||||
// the "just plow on" technique tends to work better otherwise
|
||||
} else if (err && endOfLine) {
|
||||
! do {
|
||||
if (code1 == EOF) {
|
||||
eof = gTrue;
|
||||
return EOF;
|
||||
}
|
||||
eatBits(1);
|
||||
! code1 = lookBits(13);
|
||||
! } while ((code1 >> 1) != 0x001);
|
||||
eatBits(12);
|
||||
if (encoding > 0) {
|
||||
eatBits(1);
|
||||
--- 1582,1598 ----
|
||||
// this if we know the stream contains end-of-line markers because
|
||||
// the "just plow on" technique tends to work better otherwise
|
||||
} else if (err && endOfLine) {
|
||||
! while (1) {
|
||||
! code1 = lookBits(13);
|
||||
if (code1 == EOF) {
|
||||
eof = gTrue;
|
||||
return EOF;
|
||||
}
|
||||
+ if ((code1 >> 1) == 0x001) {
|
||||
+ break;
|
||||
+ }
|
||||
eatBits(1);
|
||||
! }
|
||||
eatBits(12);
|
||||
if (encoding > 0) {
|
||||
eatBits(1);
|
||||
***************
|
||||
*** 1575,1585 ****
|
||||
}
|
||||
}
|
||||
|
||||
! a0 = 0;
|
||||
! outputBits = codingLine[1] - codingLine[0];
|
||||
! if (outputBits == 0) {
|
||||
! a0 = 1;
|
||||
! outputBits = codingLine[2] - codingLine[1];
|
||||
}
|
||||
|
||||
++row;
|
||||
--- 1600,1610 ----
|
||||
}
|
||||
}
|
||||
|
||||
! // set up for output
|
||||
! if (codingLine[0] > 0) {
|
||||
! outputBits = codingLine[a0i = 0];
|
||||
! } else {
|
||||
! outputBits = codingLine[a0i = 1];
|
||||
}
|
||||
|
||||
++row;
|
||||
***************
|
||||
*** 1587,1625 ****
|
||||
|
||||
// get a byte
|
||||
if (outputBits >= 8) {
|
||||
! ret = ((a0 & 1) == 0) ? 0xff : 0x00;
|
||||
! if ((outputBits -= 8) == 0) {
|
||||
! ++a0;
|
||||
! if (codingLine[a0] < columns) {
|
||||
! outputBits = codingLine[a0 + 1] - codingLine[a0];
|
||||
! }
|
||||
}
|
||||
} else {
|
||||
bits = 8;
|
||||
! ret = 0;
|
||||
do {
|
||||
if (outputBits > bits) {
|
||||
! i = bits;
|
||||
! bits = 0;
|
||||
! if ((a0 & 1) == 0) {
|
||||
! ret |= 0xff >> (8 - i);
|
||||
}
|
||||
! outputBits -= i;
|
||||
} else {
|
||||
! i = outputBits;
|
||||
! bits -= outputBits;
|
||||
! if ((a0 & 1) == 0) {
|
||||
! ret |= (0xff >> (8 - i)) << bits;
|
||||
}
|
||||
outputBits = 0;
|
||||
! ++a0;
|
||||
! if (codingLine[a0] < columns) {
|
||||
! outputBits = codingLine[a0 + 1] - codingLine[a0];
|
||||
}
|
||||
}
|
||||
! } while (bits > 0 && codingLine[a0] < columns);
|
||||
}
|
||||
- buf = black ? (ret ^ 0xff) : ret;
|
||||
return buf;
|
||||
}
|
||||
|
||||
--- 1612,1654 ----
|
||||
|
||||
// get a byte
|
||||
if (outputBits >= 8) {
|
||||
! buf = (a0i & 1) ? 0x00 : 0xff;
|
||||
! outputBits -= 8;
|
||||
! if (outputBits == 0 && codingLine[a0i] < columns) {
|
||||
! ++a0i;
|
||||
! outputBits = codingLine[a0i] - codingLine[a0i - 1];
|
||||
}
|
||||
} else {
|
||||
bits = 8;
|
||||
! buf = 0;
|
||||
do {
|
||||
if (outputBits > bits) {
|
||||
! buf <<= bits;
|
||||
! if (!(a0i & 1)) {
|
||||
! buf |= 0xff >> (8 - bits);
|
||||
}
|
||||
! outputBits -= bits;
|
||||
! bits = 0;
|
||||
} else {
|
||||
! buf <<= outputBits;
|
||||
! if (!(a0i & 1)) {
|
||||
! buf |= 0xff >> (8 - outputBits);
|
||||
}
|
||||
+ bits -= outputBits;
|
||||
outputBits = 0;
|
||||
! if (codingLine[a0i] < columns) {
|
||||
! ++a0i;
|
||||
! outputBits = codingLine[a0i] - codingLine[a0i - 1];
|
||||
! } else if (bits > 0) {
|
||||
! buf <<= bits;
|
||||
! bits = 0;
|
||||
}
|
||||
}
|
||||
! } while (bits);
|
||||
! }
|
||||
! if (black) {
|
||||
! buf ^= 0xff;
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
***************
|
||||
*** 1661,1666 ****
|
||||
--- 1690,1698 ----
|
||||
code = 0; // make gcc happy
|
||||
if (endOfBlock) {
|
||||
code = lookBits(12);
|
||||
+ if (code == EOF) {
|
||||
+ return 1;
|
||||
+ }
|
||||
if ((code >> 5) == 0) {
|
||||
p = &whiteTab1[code];
|
||||
} else {
|
||||
***************
|
||||
*** 1673,1678 ****
|
||||
--- 1705,1713 ----
|
||||
} else {
|
||||
for (n = 1; n <= 9; ++n) {
|
||||
code = lookBits(n);
|
||||
+ if (code == EOF) {
|
||||
+ return 1;
|
||||
+ }
|
||||
if (n < 9) {
|
||||
code <<= 9 - n;
|
||||
}
|
||||
***************
|
||||
*** 1684,1689 ****
|
||||
--- 1719,1727 ----
|
||||
}
|
||||
for (n = 11; n <= 12; ++n) {
|
||||
code = lookBits(n);
|
||||
+ if (code == EOF) {
|
||||
+ return 1;
|
||||
+ }
|
||||
if (n < 12) {
|
||||
code <<= 12 - n;
|
||||
}
|
||||
***************
|
||||
*** 1709,1717 ****
|
||||
code = 0; // make gcc happy
|
||||
if (endOfBlock) {
|
||||
code = lookBits(13);
|
||||
if ((code >> 7) == 0) {
|
||||
p = &blackTab1[code];
|
||||
! } else if ((code >> 9) == 0) {
|
||||
p = &blackTab2[(code >> 1) - 64];
|
||||
} else {
|
||||
p = &blackTab3[code >> 7];
|
||||
--- 1747,1758 ----
|
||||
code = 0; // make gcc happy
|
||||
if (endOfBlock) {
|
||||
code = lookBits(13);
|
||||
+ if (code == EOF) {
|
||||
+ return 1;
|
||||
+ }
|
||||
if ((code >> 7) == 0) {
|
||||
p = &blackTab1[code];
|
||||
! } else if ((code >> 9) == 0 && (code >> 7) != 0) {
|
||||
p = &blackTab2[(code >> 1) - 64];
|
||||
} else {
|
||||
p = &blackTab3[code >> 7];
|
||||
***************
|
||||
*** 1723,1728 ****
|
||||
--- 1764,1772 ----
|
||||
} else {
|
||||
for (n = 2; n <= 6; ++n) {
|
||||
code = lookBits(n);
|
||||
+ if (code == EOF) {
|
||||
+ return 1;
|
||||
+ }
|
||||
if (n < 6) {
|
||||
code <<= 6 - n;
|
||||
}
|
||||
***************
|
||||
*** 1734,1739 ****
|
||||
--- 1778,1786 ----
|
||||
}
|
||||
for (n = 7; n <= 12; ++n) {
|
||||
code = lookBits(n);
|
||||
+ if (code == EOF) {
|
||||
+ return 1;
|
||||
+ }
|
||||
if (n < 12) {
|
||||
code <<= 12 - n;
|
||||
}
|
||||
***************
|
||||
*** 1747,1752 ****
|
||||
--- 1794,1802 ----
|
||||
}
|
||||
for (n = 10; n <= 13; ++n) {
|
||||
code = lookBits(n);
|
||||
+ if (code == EOF) {
|
||||
+ return 1;
|
||||
+ }
|
||||
if (n < 13) {
|
||||
code <<= 13 - n;
|
||||
}
|
||||
***************
|
||||
*** 1961,1966 ****
|
||||
--- 2011,2022 ----
|
||||
// allocate a buffer for the whole image
|
||||
bufWidth = ((width + mcuWidth - 1) / mcuWidth) * mcuWidth;
|
||||
bufHeight = ((height + mcuHeight - 1) / mcuHeight) * mcuHeight;
|
||||
+ if (bufWidth <= 0 || bufHeight <= 0 ||
|
||||
+ bufWidth > INT_MAX / bufWidth / (int)sizeof(int)) {
|
||||
+ error(getPos(), "Invalid image size in DCT stream");
|
||||
+ y = height;
|
||||
+ return;
|
||||
+ }
|
||||
for (i = 0; i < numComps; ++i) {
|
||||
frameBuf[i] = (int *)gmallocn(bufWidth * bufHeight, sizeof(int));
|
||||
memset(frameBuf[i], 0, bufWidth * bufHeight * sizeof(int));
|
||||
***************
|
||||
*** 3036,3041 ****
|
||||
--- 3092,3102 ----
|
||||
}
|
||||
scanInfo.firstCoeff = str->getChar();
|
||||
scanInfo.lastCoeff = str->getChar();
|
||||
+ if (scanInfo.firstCoeff < 0 || scanInfo.lastCoeff > 63 ||
|
||||
+ scanInfo.firstCoeff > scanInfo.lastCoeff) {
|
||||
+ error(getPos(), "Bad DCT coefficient numbers in scan info block");
|
||||
+ return gFalse;
|
||||
+ }
|
||||
c = str->getChar();
|
||||
scanInfo.ah = (c >> 4) & 0x0f;
|
||||
scanInfo.al = c & 0x0f;
|
||||
diff -c -r xpdf-3.02pl1.orig/xpdf/Stream.h xpdf-3.02/xpdf/Stream.h
|
||||
*** xpdf-3.02pl1.orig/xpdf/Stream.h Tue Feb 27 14:05:52 2007
|
||||
--- xpdf-3.02/xpdf/Stream.h Thu Oct 25 15:48:15 2007
|
||||
***************
|
||||
*** 528,540 ****
|
||||
int row; // current row
|
||||
int inputBuf; // input buffer
|
||||
int inputBits; // number of bits in input buffer
|
||||
! short *refLine; // reference line changing elements
|
||||
! int b1; // index into refLine
|
||||
! short *codingLine; // coding line changing elements
|
||||
! int a0; // index into codingLine
|
||||
int outputBits; // remaining ouput bits
|
||||
int buf; // character buffer
|
||||
|
||||
short getTwoDimCode();
|
||||
short getWhiteCode();
|
||||
short getBlackCode();
|
||||
--- 528,542 ----
|
||||
int row; // current row
|
||||
int inputBuf; // input buffer
|
||||
int inputBits; // number of bits in input buffer
|
||||
! int *codingLine; // coding line changing elements
|
||||
! int *refLine; // reference line changing elements
|
||||
! int a0i; // index into codingLine
|
||||
! GBool err; // error on current line
|
||||
int outputBits; // remaining ouput bits
|
||||
int buf; // character buffer
|
||||
|
||||
+ void addPixels(int a1, int black);
|
||||
+ void addPixelsNeg(int a1, int black);
|
||||
short getTwoDimCode();
|
||||
short getWhiteCode();
|
||||
short getBlackCode();
|
||||
1145
xpdf-3.02pl3.patch
Normal file
1145
xpdf-3.02pl3.patch
Normal file
File diff suppressed because it is too large
Load diff
282
xpdf-3.02pl4.patch
Normal file
282
xpdf-3.02pl4.patch
Normal file
|
|
@ -0,0 +1,282 @@
|
|||
*** xpdf-3.02.orig/xpdf/Stream.cc Fri Jul 24 14:30:46 2009
|
||||
--- xpdf-3.02/xpdf/Stream.cc Mon Oct 5 11:07:49 2009
|
||||
***************
|
||||
*** 323,328 ****
|
||||
--- 323,332 ----
|
||||
} else {
|
||||
imgLineSize = nVals;
|
||||
}
|
||||
+ if (width > INT_MAX / nComps) {
|
||||
+ // force a call to gmallocn(-1,...), which will throw an exception
|
||||
+ imgLineSize = -1;
|
||||
+ }
|
||||
imgLine = (Guchar *)gmallocn(imgLineSize, sizeof(Guchar));
|
||||
imgIdx = nVals;
|
||||
}
|
||||
*** xpdf-3.02.orig/xpdf/PSOutputDev.cc Tue Feb 27 14:05:52 2007
|
||||
--- xpdf-3.02/xpdf/PSOutputDev.cc Fri Oct 2 12:38:58 2009
|
||||
***************
|
||||
*** 4301,4307 ****
|
||||
width, -height, height);
|
||||
|
||||
// allocate a line buffer
|
||||
! lineBuf = (Guchar *)gmalloc(4 * width);
|
||||
|
||||
// set up to process the data stream
|
||||
imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(),
|
||||
--- 4301,4307 ----
|
||||
width, -height, height);
|
||||
|
||||
// allocate a line buffer
|
||||
! lineBuf = (Guchar *)gmallocn(width, 4);
|
||||
|
||||
// set up to process the data stream
|
||||
imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(),
|
||||
diff -r -c xpdf-3.02.orig/splash/Splash.cc xpdf-3.02/splash/Splash.cc
|
||||
*** xpdf-3.02.orig/splash/Splash.cc Tue Feb 27 14:05:52 2007
|
||||
--- xpdf-3.02/splash/Splash.cc Fri Aug 14 14:05:08 2009
|
||||
***************
|
||||
*** 12,17 ****
|
||||
--- 12,18 ----
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
+ #include <limits.h>
|
||||
#include "gmem.h"
|
||||
#include "SplashErrorCodes.h"
|
||||
#include "SplashMath.h"
|
||||
***************
|
||||
*** 1912,1918 ****
|
||||
xq = w % scaledWidth;
|
||||
|
||||
// allocate pixel buffer
|
||||
! pixBuf = (SplashColorPtr)gmalloc((yp + 1) * w);
|
||||
|
||||
// initialize the pixel pipe
|
||||
pipeInit(&pipe, 0, 0, state->fillPattern, NULL, state->fillAlpha,
|
||||
--- 1913,1922 ----
|
||||
xq = w % scaledWidth;
|
||||
|
||||
// allocate pixel buffer
|
||||
! if (yp < 0 || yp > INT_MAX - 1) {
|
||||
! return splashErrBadArg;
|
||||
! }
|
||||
! pixBuf = (SplashColorPtr)gmallocn(yp + 1, w);
|
||||
|
||||
// initialize the pixel pipe
|
||||
pipeInit(&pipe, 0, 0, state->fillPattern, NULL, state->fillAlpha,
|
||||
***************
|
||||
*** 2208,2216 ****
|
||||
xq = w % scaledWidth;
|
||||
|
||||
// allocate pixel buffers
|
||||
! colorBuf = (SplashColorPtr)gmalloc((yp + 1) * w * nComps);
|
||||
if (srcAlpha) {
|
||||
! alphaBuf = (Guchar *)gmalloc((yp + 1) * w);
|
||||
} else {
|
||||
alphaBuf = NULL;
|
||||
}
|
||||
--- 2212,2223 ----
|
||||
xq = w % scaledWidth;
|
||||
|
||||
// allocate pixel buffers
|
||||
! if (yp < 0 || yp > INT_MAX - 1 || w > INT_MAX / nComps) {
|
||||
! return splashErrBadArg;
|
||||
! }
|
||||
! colorBuf = (SplashColorPtr)gmallocn(yp + 1, w * nComps);
|
||||
if (srcAlpha) {
|
||||
! alphaBuf = (Guchar *)gmallocn(yp + 1, w);
|
||||
} else {
|
||||
alphaBuf = NULL;
|
||||
}
|
||||
diff -r -c xpdf-3.02.orig/splash/SplashErrorCodes.h xpdf-3.02/splash/SplashErrorCodes.h
|
||||
*** xpdf-3.02.orig/splash/SplashErrorCodes.h Tue Feb 27 14:05:52 2007
|
||||
--- xpdf-3.02/splash/SplashErrorCodes.h Fri Aug 14 14:03:46 2009
|
||||
***************
|
||||
*** 29,32 ****
|
||||
--- 29,34 ----
|
||||
|
||||
#define splashErrSingularMatrix 8 // matrix is singular
|
||||
|
||||
+ #define splashErrBadArg 9 // bad argument
|
||||
+
|
||||
#endif
|
||||
*** xpdf-3.02.orig/splash/SplashBitmap.cc Tue Feb 27 14:05:52 2007
|
||||
--- xpdf-3.02/splash/SplashBitmap.cc Wed Aug 19 14:55:39 2009
|
||||
***************
|
||||
*** 11,16 ****
|
||||
--- 11,17 ----
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
+ #include <limits.h>
|
||||
#include "gmem.h"
|
||||
#include "SplashErrorCodes.h"
|
||||
#include "SplashBitmap.h"
|
||||
***************
|
||||
*** 27,56 ****
|
||||
mode = modeA;
|
||||
switch (mode) {
|
||||
case splashModeMono1:
|
||||
! rowSize = (width + 7) >> 3;
|
||||
break;
|
||||
case splashModeMono8:
|
||||
! rowSize = width;
|
||||
break;
|
||||
case splashModeRGB8:
|
||||
case splashModeBGR8:
|
||||
! rowSize = width * 3;
|
||||
break;
|
||||
#if SPLASH_CMYK
|
||||
case splashModeCMYK8:
|
||||
! rowSize = width * 4;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
! rowSize += rowPad - 1;
|
||||
! rowSize -= rowSize % rowPad;
|
||||
! data = (SplashColorPtr)gmalloc(rowSize * height);
|
||||
if (!topDown) {
|
||||
data += (height - 1) * rowSize;
|
||||
rowSize = -rowSize;
|
||||
}
|
||||
if (alphaA) {
|
||||
! alpha = (Guchar *)gmalloc(width * height);
|
||||
} else {
|
||||
alpha = NULL;
|
||||
}
|
||||
--- 28,75 ----
|
||||
mode = modeA;
|
||||
switch (mode) {
|
||||
case splashModeMono1:
|
||||
! if (width > 0) {
|
||||
! rowSize = (width + 7) >> 3;
|
||||
! } else {
|
||||
! rowSize = -1;
|
||||
! }
|
||||
break;
|
||||
case splashModeMono8:
|
||||
! if (width > 0) {
|
||||
! rowSize = width;
|
||||
! } else {
|
||||
! rowSize = -1;
|
||||
! }
|
||||
break;
|
||||
case splashModeRGB8:
|
||||
case splashModeBGR8:
|
||||
! if (width > 0 && width <= INT_MAX / 3) {
|
||||
! rowSize = width * 3;
|
||||
! } else {
|
||||
! rowSize = -1;
|
||||
! }
|
||||
break;
|
||||
#if SPLASH_CMYK
|
||||
case splashModeCMYK8:
|
||||
! if (width > 0 && width <= INT_MAX / 4) {
|
||||
! rowSize = width * 4;
|
||||
! } else {
|
||||
! rowSize = -1;
|
||||
! }
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
! if (rowSize > 0) {
|
||||
! rowSize += rowPad - 1;
|
||||
! rowSize -= rowSize % rowPad;
|
||||
! }
|
||||
! data = (SplashColorPtr)gmallocn(height, rowSize);
|
||||
if (!topDown) {
|
||||
data += (height - 1) * rowSize;
|
||||
rowSize = -rowSize;
|
||||
}
|
||||
if (alphaA) {
|
||||
! alpha = (Guchar *)gmallocn(width, height);
|
||||
} else {
|
||||
alpha = NULL;
|
||||
}
|
||||
*** xpdf-3.02.orig/xpdf/XRef.cc Tue Feb 27 14:05:52 2007
|
||||
--- xpdf-3.02/xpdf/XRef.cc Tue Oct 13 11:57:24 2009
|
||||
***************
|
||||
*** 52,57 ****
|
||||
--- 52,59 ----
|
||||
// generation 0.
|
||||
ObjectStream(XRef *xref, int objStrNumA);
|
||||
|
||||
+ GBool isOk() { return ok; }
|
||||
+
|
||||
~ObjectStream();
|
||||
|
||||
// Return the object number of this object stream.
|
||||
***************
|
||||
*** 67,72 ****
|
||||
--- 69,75 ----
|
||||
int nObjects; // number of objects in the stream
|
||||
Object *objs; // the objects (length = nObjects)
|
||||
int *objNums; // the object numbers (length = nObjects)
|
||||
+ GBool ok;
|
||||
};
|
||||
|
||||
ObjectStream::ObjectStream(XRef *xref, int objStrNumA) {
|
||||
***************
|
||||
*** 80,85 ****
|
||||
--- 83,89 ----
|
||||
nObjects = 0;
|
||||
objs = NULL;
|
||||
objNums = NULL;
|
||||
+ ok = gFalse;
|
||||
|
||||
if (!xref->fetch(objStrNum, 0, &objStr)->isStream()) {
|
||||
goto err1;
|
||||
***************
|
||||
*** 105,110 ****
|
||||
--- 109,121 ----
|
||||
goto err1;
|
||||
}
|
||||
|
||||
+ // this is an arbitrary limit to avoid integer overflow problems
|
||||
+ // in the 'new Object[nObjects]' call (Acrobat apparently limits
|
||||
+ // object streams to 100-200 objects)
|
||||
+ if (nObjects > 1000000) {
|
||||
+ error(-1, "Too many objects in an object stream");
|
||||
+ goto err1;
|
||||
+ }
|
||||
objs = new Object[nObjects];
|
||||
objNums = (int *)gmallocn(nObjects, sizeof(int));
|
||||
offsets = (int *)gmallocn(nObjects, sizeof(int));
|
||||
***************
|
||||
*** 161,170 ****
|
||||
}
|
||||
|
||||
gfree(offsets);
|
||||
|
||||
err1:
|
||||
objStr.free();
|
||||
- return;
|
||||
}
|
||||
|
||||
ObjectStream::~ObjectStream() {
|
||||
--- 172,181 ----
|
||||
}
|
||||
|
||||
gfree(offsets);
|
||||
+ ok = gTrue;
|
||||
|
||||
err1:
|
||||
objStr.free();
|
||||
}
|
||||
|
||||
ObjectStream::~ObjectStream() {
|
||||
***************
|
||||
*** 837,842 ****
|
||||
--- 848,858 ----
|
||||
delete objStr;
|
||||
}
|
||||
objStr = new ObjectStream(this, e->offset);
|
||||
+ if (!objStr->isOk()) {
|
||||
+ delete objStr;
|
||||
+ objStr = NULL;
|
||||
+ goto err;
|
||||
+ }
|
||||
}
|
||||
objStr->getObject(e->gen, num, obj);
|
||||
break;
|
||||
41
xpdf-3.02pl5.patch
Normal file
41
xpdf-3.02pl5.patch
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
*** xpdf-3.02.orig/xpdf/Gfx.cc Tue Feb 27 14:05:52 2007
|
||||
--- xpdf-3.02/xpdf/Gfx.cc Mon Oct 11 15:39:52 2010
|
||||
***************
|
||||
*** 461,466 ****
|
||||
--- 461,467 ----
|
||||
baseMatrix[i] = state->getCTM()[i];
|
||||
}
|
||||
formDepth = 0;
|
||||
+ parser = NULL;
|
||||
abortCheckCbk = abortCheckCbkA;
|
||||
abortCheckCbkData = abortCheckCbkDataA;
|
||||
|
||||
***************
|
||||
*** 500,505 ****
|
||||
--- 501,507 ----
|
||||
baseMatrix[i] = state->getCTM()[i];
|
||||
}
|
||||
formDepth = 0;
|
||||
+ parser = NULL;
|
||||
abortCheckCbk = abortCheckCbkA;
|
||||
abortCheckCbkData = abortCheckCbkDataA;
|
||||
|
||||
*** xpdf-3.02.orig/fofi/FoFiType1.cc Tue Feb 27 14:05:51 2007
|
||||
--- xpdf-3.02/fofi/FoFiType1.cc Mon Oct 11 15:44:13 2010
|
||||
***************
|
||||
*** 224,230 ****
|
||||
code = code * 8 + (*p2 - '0');
|
||||
}
|
||||
}
|
||||
! if (code < 256) {
|
||||
for (p = p2; *p == ' ' || *p == '\t'; ++p) ;
|
||||
if (*p == '/') {
|
||||
++p;
|
||||
--- 224,230 ----
|
||||
code = code * 8 + (*p2 - '0');
|
||||
}
|
||||
}
|
||||
! if (code >= 0 && code < 256) {
|
||||
for (p = p2; *p == ' ' || *p == '\t'; ++p) ;
|
||||
if (*p == '/') {
|
||||
++p;
|
||||
57
xpdf-3.03-64bit.patch
Normal file
57
xpdf-3.03-64bit.patch
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
diff -up xpdf-3.03/goo/gmem.cc.alloc xpdf-3.03/goo/gmem.cc
|
||||
--- xpdf-3.03/goo/gmem.cc.alloc 2011-08-15 17:08:53.000000000 -0400
|
||||
+++ xpdf-3.03/goo/gmem.cc 2011-08-22 13:48:31.891115878 -0400
|
||||
@@ -47,9 +47,9 @@ static int gMemInUse = 0;
|
||||
|
||||
#endif /* DEBUG_MEM */
|
||||
|
||||
-void *gmalloc(int size) GMEM_EXCEP {
|
||||
+void *gmalloc(size_t size) GMEM_EXCEP {
|
||||
#ifdef DEBUG_MEM
|
||||
- int size1;
|
||||
+ size_t size1;
|
||||
char *mem;
|
||||
GMemHdr *hdr;
|
||||
void *data;
|
||||
@@ -122,11 +122,11 @@ void *gmalloc(int size) GMEM_EXCEP {
|
||||
#endif
|
||||
}
|
||||
|
||||
-void *grealloc(void *p, int size) GMEM_EXCEP {
|
||||
+void *grealloc(void *p, size_t size) GMEM_EXCEP {
|
||||
#ifdef DEBUG_MEM
|
||||
GMemHdr *hdr;
|
||||
void *q;
|
||||
- int oldSize;
|
||||
+ size_t oldSize;
|
||||
|
||||
if (size < 0) {
|
||||
#if USE_EXCEPTIONS
|
||||
@@ -227,7 +227,7 @@ void *greallocn(void *p, int nObjs, int
|
||||
|
||||
void gfree(void *p) {
|
||||
#ifdef DEBUG_MEM
|
||||
- int size;
|
||||
+ size_t size;
|
||||
GMemHdr *hdr;
|
||||
unsigned long *trl, *clr;
|
||||
|
||||
diff -up xpdf-3.03/goo/gmem.h.alloc xpdf-3.03/goo/gmem.h
|
||||
--- xpdf-3.03/goo/gmem.h.alloc 2011-08-15 17:08:53.000000000 -0400
|
||||
+++ xpdf-3.03/goo/gmem.h 2011-08-22 13:47:27.274853540 -0400
|
||||
@@ -36,13 +36,13 @@ extern "C" {
|
||||
* Same as malloc, but prints error message and exits if malloc()
|
||||
* returns NULL.
|
||||
*/
|
||||
-extern void *gmalloc(int size) GMEM_EXCEP;
|
||||
+extern void *gmalloc(size_t size) GMEM_EXCEP;
|
||||
|
||||
/*
|
||||
* Same as realloc, but prints error message and exits if realloc()
|
||||
* returns NULL. If <p> is NULL, calls malloc instead of realloc().
|
||||
*/
|
||||
-extern void *grealloc(void *p, int size) GMEM_EXCEP;
|
||||
+extern void *grealloc(void *p, size_t size) GMEM_EXCEP;
|
||||
|
||||
/*
|
||||
* These are similar to gmalloc and grealloc, but take an object count
|
||||
55
xpdf-3.03-CVE-2012-2142.diff
Normal file
55
xpdf-3.03-CVE-2012-2142.diff
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
From 3945969e0072217c143fefa3044512a31ac2afa8 Mon Sep 17 00:00:00 2001
|
||||
From: mancha <mancha1@hush.com>
|
||||
Date: Sun, 11 Aug 2013
|
||||
Subject: CVE-2012-2142
|
||||
|
||||
Filter stuff that might end up in the shell to address CVE-2012-2142.
|
||||
This code was adapted from the Poppler project.
|
||||
---
|
||||
Error.cc | 21 ++++++++++++++++-----
|
||||
1 file changed, 16 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/xpdf/Error.cc 2013-08-11
|
||||
+++ b/xpdf/Error.cc 2013-08-11
|
||||
@@ -43,7 +43,7 @@ void setErrorCallback(void (*cbk)(void *
|
||||
|
||||
void CDECL error(ErrorCategory category, int pos, const char *msg, ...) {
|
||||
va_list args;
|
||||
- GString *s;
|
||||
+ GString *s, *sanitized;
|
||||
|
||||
// NB: this can be called before the globalParams object is created
|
||||
if (!errorCbk && globalParams && globalParams->getErrQuiet()) {
|
||||
@@ -52,17 +52,28 @@ void CDECL error(ErrorCategory category,
|
||||
va_start(args, msg);
|
||||
s = GString::formatv(msg, args);
|
||||
va_end(args);
|
||||
+
|
||||
+ sanitized = new GString ();
|
||||
+ for (int i = 0; i < s->getLength(); ++i) {
|
||||
+ const char c = s->getChar(i);
|
||||
+ if (c < (char)0x20 || c >= (char)0x7f) {
|
||||
+ sanitized->appendf("<{0:02x}>", c & 0xff);
|
||||
+ } else {
|
||||
+ sanitized->append(c);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (errorCbk) {
|
||||
- (*errorCbk)(errorCbkData, category, pos, s->getCString());
|
||||
+ (*errorCbk)(errorCbkData, category, pos, sanitized->getCString());
|
||||
} else {
|
||||
if (pos >= 0) {
|
||||
fprintf(stderr, "%s (%d): %s\n",
|
||||
- errorCategoryNames[category], pos, s->getCString());
|
||||
+ errorCategoryNames[category], pos, sanitized->getCString());
|
||||
} else {
|
||||
fprintf(stderr, "%s: %s\n",
|
||||
- errorCategoryNames[category], s->getCString());
|
||||
+ errorCategoryNames[category], sanitized->getCString());
|
||||
}
|
||||
fflush(stderr);
|
||||
}
|
||||
- delete s;
|
||||
+ delete sanitized;
|
||||
}
|
||||
12
xpdf-3.03-compile-fix.patch
Normal file
12
xpdf-3.03-compile-fix.patch
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
diff -up xpdf-3.03/xpdf/XPDFViewer.cc.BAD xpdf-3.03/xpdf/XPDFViewer.cc
|
||||
--- xpdf-3.03/xpdf/XPDFViewer.cc.BAD 2011-08-22 14:19:42.845075813 -0400
|
||||
+++ xpdf-3.03/xpdf/XPDFViewer.cc 2011-08-22 14:19:47.953013145 -0400
|
||||
@@ -1807,7 +1807,7 @@ void XPDFViewer::initToolbar(Widget pare
|
||||
menuPane = XmCreatePulldownMenu(toolBar, "zoomMenuPane", args, n);
|
||||
for (i = 0; i < nZoomMenuItems; ++i) {
|
||||
n = 0;
|
||||
- s = XmStringCreateLocalized(zoomMenuInfo[i].label);
|
||||
+ s = XmStringCreateLocalized((char *)zoomMenuInfo[i].label);
|
||||
XtSetArg(args[n], XmNlabelString, s); ++n;
|
||||
XtSetArg(args[n], XmNuserData, (XtPointer)i); ++n;
|
||||
sprintf(buf, "zoom%d", i);
|
||||
48
xpdf-3.03-crash.patch
Normal file
48
xpdf-3.03-crash.patch
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
diff -up xpdf-3.03/fofi/FoFiType1.cc.crash xpdf-3.03/fofi/FoFiType1.cc
|
||||
--- xpdf-3.03/fofi/FoFiType1.cc.crash 2011-08-15 17:08:53.000000000 -0400
|
||||
+++ xpdf-3.03/fofi/FoFiType1.cc 2011-08-22 13:44:32.936859153 -0400
|
||||
@@ -268,9 +268,14 @@ void FoFiType1::parse() {
|
||||
}
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
diff -up xpdf-3.03/splash/Splash.cc.crash xpdf-3.03/splash/Splash.cc
|
||||
--- xpdf-3.03/splash/Splash.cc.crash 2011-08-15 17:08:53.000000000 -0400
|
||||
+++ xpdf-3.03/splash/Splash.cc 2011-08-22 13:46:54.295231194 -0400
|
||||
@@ -2053,6 +2053,11 @@ SplashError Splash::fillWithPattern(Spla
|
||||
xPath->aaScale();
|
||||
}
|
||||
xPath->sort();
|
||||
+ if (!&xPath->segs[0])
|
||||
+ {
|
||||
+ delete xPath;
|
||||
+ return splashErrEmptyPath;
|
||||
+ }
|
||||
yMinI = state->clip->getYMinI();
|
||||
yMaxI = state->clip->getYMaxI();
|
||||
if (vectorAntialias && !inShading) {
|
||||
@@ -2194,6 +2199,11 @@ SplashError Splash::xorFill(SplashPath *
|
||||
}
|
||||
xPath = new SplashXPath(path, state->matrix, state->flatness, gTrue);
|
||||
xPath->sort();
|
||||
+ if (!&xPath->segs[0])
|
||||
+ {
|
||||
+ delete xPath;
|
||||
+ return splashErrEmptyPath;
|
||||
+ }
|
||||
scanner = new SplashXPathScanner(xPath, eo, state->clip->getYMinI(),
|
||||
state->clip->getYMaxI());
|
||||
|
||||
57
xpdf-3.04-64bit.patch
Normal file
57
xpdf-3.04-64bit.patch
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
diff -up xpdf-3.04/goo/gmem.cc.alloc xpdf-3.04/goo/gmem.cc
|
||||
--- xpdf-3.04/goo/gmem.cc.alloc 2014-05-28 14:50:50.000000000 -0400
|
||||
+++ xpdf-3.04/goo/gmem.cc 2014-05-29 15:00:18.670819951 -0400
|
||||
@@ -48,9 +48,9 @@ static int gMaxMemInUse = 0;
|
||||
|
||||
#endif /* DEBUG_MEM */
|
||||
|
||||
-void *gmalloc(int size) GMEM_EXCEP {
|
||||
+void *gmalloc(size_t size) GMEM_EXCEP {
|
||||
#ifdef DEBUG_MEM
|
||||
- int size1;
|
||||
+ size_t size1;
|
||||
char *mem;
|
||||
GMemHdr *hdr;
|
||||
void *data;
|
||||
@@ -106,11 +106,11 @@ void *gmalloc(int size) GMEM_EXCEP {
|
||||
#endif
|
||||
}
|
||||
|
||||
-void *grealloc(void *p, int size) GMEM_EXCEP {
|
||||
+void *grealloc(void *p, size_t size) GMEM_EXCEP {
|
||||
#ifdef DEBUG_MEM
|
||||
GMemHdr *hdr;
|
||||
void *q;
|
||||
- int oldSize;
|
||||
+ size_t oldSize;
|
||||
|
||||
if (size < 0) {
|
||||
gMemError("Invalid memory allocation size");
|
||||
@@ -186,7 +186,7 @@ void *greallocn(void *p, int nObjs, int
|
||||
|
||||
void gfree(void *p) {
|
||||
#ifdef DEBUG_MEM
|
||||
- int size;
|
||||
+ size_t size;
|
||||
GMemHdr *hdr;
|
||||
unsigned long *trl, *clr;
|
||||
|
||||
diff -up xpdf-3.04/goo/gmem.h.alloc xpdf-3.04/goo/gmem.h
|
||||
--- xpdf-3.04/goo/gmem.h.alloc 2014-05-28 14:50:50.000000000 -0400
|
||||
+++ xpdf-3.04/goo/gmem.h 2014-05-29 14:59:04.364344108 -0400
|
||||
@@ -36,13 +36,13 @@ extern "C" {
|
||||
* Same as malloc, but prints error message and exits if malloc()
|
||||
* returns NULL.
|
||||
*/
|
||||
-extern void *gmalloc(int size) GMEM_EXCEP;
|
||||
+extern void *gmalloc(size_t size) GMEM_EXCEP;
|
||||
|
||||
/*
|
||||
* Same as realloc, but prints error message and exits if realloc()
|
||||
* returns NULL. If <p> is NULL, calls malloc instead of realloc().
|
||||
*/
|
||||
-extern void *grealloc(void *p, int size) GMEM_EXCEP;
|
||||
+extern void *grealloc(void *p, size_t size) GMEM_EXCEP;
|
||||
|
||||
/*
|
||||
* These are similar to gmalloc and grealloc, but take an object count
|
||||
11
xpdf-3.04-localized.patch
Normal file
11
xpdf-3.04-localized.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
diff -up xpdf-3.04/xpdf/XPDFApp.cc.localized xpdf-3.04/xpdf/XPDFApp.cc
|
||||
--- xpdf-3.04/xpdf/XPDFApp.cc.localized 2014-12-02 13:54:56.720680945 -0500
|
||||
+++ xpdf-3.04/xpdf/XPDFApp.cc 2014-12-02 13:55:10.257585002 -0500
|
||||
@@ -125,6 +125,7 @@ static int xErrorHandler(Display *displa
|
||||
#endif
|
||||
|
||||
XPDFApp::XPDFApp(int *argc, char *argv[]) {
|
||||
+ XtSetLanguageProc(NULL, (XtLanguageProc)NULL, NULL);
|
||||
appShell = XtAppInitialize(&appContext, xpdfAppName, xOpts, nXOpts,
|
||||
argc, argv, fallbackResources, NULL, 0);
|
||||
display = XtDisplay(appShell);
|
||||
53
xpdf-3.04-nocmap.patch
Normal file
53
xpdf-3.04-nocmap.patch
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
diff -up xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc.orig xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc
|
||||
--- xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc.orig 2014-05-29 15:01:29.238318492 -0400
|
||||
+++ xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc 2014-05-29 15:02:30.453883329 -0400
|
||||
@@ -3,7 +3,7 @@ cidToUnicode Adobe-GB1 /usr/share/xpdf/ch
|
||||
unicodeMap ISO-2022-CN /usr/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap
|
||||
unicodeMap EUC-CN /usr/share/xpdf/chinese-simplified/EUC-CN.unicodeMap
|
||||
unicodeMap GBK /usr/share/xpdf/chinese-simplified/GBK.unicodeMap
|
||||
-cMapDir Adobe-GB1 /usr/share/xpdf/chinese-simplified/CMap
|
||||
-toUnicodeDir /usr/share/xpdf/chinese-simplified/CMap
|
||||
+#cMapDir Adobe-GB1 /usr/share/xpdf/chinese-simplified/CMap
|
||||
+#toUnicodeDir /usr/share/xpdf/chinese-simplified/CMap
|
||||
#fontFileCC Adobe-GB1 /usr/..../gkai00mp.ttf
|
||||
#----- end Chinese Simplified support package
|
||||
diff -up xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc.orig xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc
|
||||
--- xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc.orig 2014-05-29 15:01:29.237318499 -0400
|
||||
+++ xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc 2014-05-29 15:02:01.979085766 -0400
|
||||
@@ -2,7 +2,7 @@
|
||||
cidToUnicode Adobe-CNS1 /usr/share/xpdf/chinese-traditional/Adobe-CNS1.cidToUnicode
|
||||
unicodeMap Big5 /usr/share/xpdf/chinese-traditional/Big5.unicodeMap
|
||||
unicodeMap Big5ascii /usr/share/xpdf/chinese-traditional/Big5ascii.unicodeMap
|
||||
-cMapDir Adobe-CNS1 /usr/share/xpdf/chinese-traditional/CMap
|
||||
-toUnicodeDir /usr/share/xpdf/chinese-traditional/CMap
|
||||
+#cMapDir Adobe-CNS1 /usr/share/xpdf/chinese-traditional/CMap
|
||||
+#toUnicodeDir /usr/share/xpdf/chinese-traditional/CMap
|
||||
#fontFileCC Adobe-CNS1 /usr/..../bkai00mp.ttf
|
||||
#----- end Chinese Traditional support package
|
||||
diff -up xpdf-3.04/xpdf-japanese/add-to-xpdfrc.orig xpdf-3.04/xpdf-japanese/add-to-xpdfrc
|
||||
--- xpdf-3.04/xpdf-japanese/add-to-xpdfrc.orig 2014-05-29 15:01:29.238318492 -0400
|
||||
+++ xpdf-3.04/xpdf-japanese/add-to-xpdfrc 2014-05-29 15:02:43.814788329 -0400
|
||||
@@ -3,7 +3,7 @@ cidToUnicode Adobe-Japan1 /usr/share/xpdf
|
||||
unicodeMap ISO-2022-JP /usr/share/xpdf/japanese/ISO-2022-JP.unicodeMap
|
||||
unicodeMap EUC-JP /usr/share/xpdf/japanese/EUC-JP.unicodeMap
|
||||
unicodeMap Shift-JIS /usr/share/xpdf/japanese/Shift-JIS.unicodeMap
|
||||
-cMapDir Adobe-Japan1 /usr/share/xpdf/japanese/CMap
|
||||
-toUnicodeDir /usr/share/xpdf/japanese/CMap
|
||||
+#cMapDir Adobe-Japan1 /usr/share/xpdf/japanese/CMap
|
||||
+#toUnicodeDir /usr/share/xpdf/japanese/CMap
|
||||
#fontFileCC Adobe-Japan1 /usr/..../kochi-mincho.ttf
|
||||
#----- end Japanese support package
|
||||
diff -up xpdf-3.04/xpdf-korean/add-to-xpdfrc.orig xpdf-3.04/xpdf-korean/add-to-xpdfrc
|
||||
--- xpdf-3.04/xpdf-korean/add-to-xpdfrc.orig 2014-05-29 15:01:29.238318492 -0400
|
||||
+++ xpdf-3.04/xpdf-korean/add-to-xpdfrc 2014-05-29 15:02:16.581981953 -0400
|
||||
@@ -1,8 +1,8 @@
|
||||
#----- begin Korean support package (2011-sep-02)
|
||||
cidToUnicode Adobe-Korea1 /usr/share/xpdf/korean/Adobe-Korea1.cidToUnicode
|
||||
unicodeMap ISO-2022-KR /usr/share/xpdf/korean/ISO-2022-KR.unicodeMap
|
||||
-cMapDir Adobe-Korea1 /usr/share/xpdf/korean/CMap
|
||||
-toUnicodeDir /usr/share/xpdf/korean/CMap
|
||||
+#cMapDir Adobe-Korea1 /usr/share/xpdf/korean/CMap
|
||||
+#toUnicodeDir /usr/share/xpdf/korean/CMap
|
||||
#fontFileCC Adobe-Korea1 /usr/..../batang.ttf"
|
||||
#fontFileCC Unidocs-Korea1 /usr/..../batang.ttf"
|
||||
#----- end Korean support package
|
||||
32
xpdf-3.04-pdftopng.patch
Normal file
32
xpdf-3.04-pdftopng.patch
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
diff -up xpdf-3.04/Makefile.in.pdftopng xpdf-3.04/Makefile.in
|
||||
--- xpdf-3.04/Makefile.in.pdftopng 2014-05-29 15:56:14.405875939 -0400
|
||||
+++ xpdf-3.04/Makefile.in 2014-05-29 15:58:11.755031543 -0400
|
||||
@@ -37,6 +37,12 @@ xpdf: dummy
|
||||
cd @UP_DIR@splash; $(MAKE)
|
||||
cd @UP_DIR@xpdf; $(MAKE) xpdf$(EXE)
|
||||
|
||||
+pdftopng: dummy
|
||||
+ cd goo; $(MAKE)
|
||||
+ cd @UP_DIR@fofi; $(MAKE)
|
||||
+ cd @UP_DIR@splash; $(MAKE)
|
||||
+ cd @UP_DIR@xpdf; $(MAKE) pdftopng$(EXE)
|
||||
+
|
||||
pdftops: dummy
|
||||
cd goo; $(MAKE)
|
||||
cd @UP_DIR@fofi; $(MAKE)
|
||||
@@ -91,6 +97,7 @@ install: dummy
|
||||
$(INSTALL_PROGRAM) xpdf/pdfdetach$(EXE) $(DESTDIR)@bindir@/pdfdetach$(EXE)
|
||||
@X@ $(INSTALL_PROGRAM) xpdf/pdftoppm$(EXE) $(DESTDIR)@bindir@/pdftoppm$(EXE)
|
||||
$(INSTALL_PROGRAM) xpdf/pdfimages$(EXE) $(DESTDIR)@bindir@/pdfimages$(EXE)
|
||||
+ $(INSTALL_PROGRAM) xpdf/pdftopng$(EXE) $(DESTDIR)@bindir@/pdftopng$(EXE)
|
||||
-mkdir -p $(DESTDIR)@mandir@/man1
|
||||
@X@ $(INSTALL_DATA) $(srcdir)/doc/xpdf.1 $(DESTDIR)@mandir@/man1/xpdf.1
|
||||
$(INSTALL_DATA) $(srcdir)/doc/pdftops.1 $(DESTDIR)@mandir@/man1/pdftops.1
|
||||
@@ -100,6 +107,7 @@ install: dummy
|
||||
$(INSTALL_DATA) $(srcdir)/doc/pdfdetach.1 $(DESTDIR)@mandir@/man1/pdfdetach.1
|
||||
@X@ $(INSTALL_DATA) $(srcdir)/doc/pdftoppm.1 $(DESTDIR)@mandir@/man1/pdftoppm.1
|
||||
$(INSTALL_DATA) $(srcdir)/doc/pdfimages.1 $(DESTDIR)@mandir@/man1/pdfimages.1
|
||||
+ $(INSTALL_DATA) $(srcdir)/doc/pdftopng.1 $(DESTDIR)@mandir@/man1/pdftopng.1
|
||||
-mkdir -p $(DESTDIR)@mandir@/man5
|
||||
$(INSTALL_DATA) $(srcdir)/doc/xpdfrc.5 $(DESTDIR)@mandir@/man5/xpdfrc.5
|
||||
-mkdir -p $(DESTDIR)@sysconfdir@
|
||||
136
xpdf-3.04-redhat-new.patch
Normal file
136
xpdf-3.04-redhat-new.patch
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
diff -up xpdf-3.04/doc/sample-xpdfrc.orig xpdf-3.04/doc/sample-xpdfrc
|
||||
--- xpdf-3.04/doc/sample-xpdfrc.orig 2014-05-28 14:50:50.000000000 -0400
|
||||
+++ xpdf-3.04/doc/sample-xpdfrc 2014-05-29 14:50:23.704974484 -0400
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
# Set the default PostScript file or command.
|
||||
|
||||
-#psFile "|lpr -Pmyprinter"
|
||||
+psFile "|lpr"
|
||||
|
||||
# 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,10 @@
|
||||
# clicked.
|
||||
|
||||
#launchCommand viewer-script
|
||||
-#urlCommand "netscape -remote 'openURL(%s)'"
|
||||
+urlCommand "xdg-open '%s'"
|
||||
+
|
||||
+# CJK
|
||||
+include /etc/xpdf/add-to-xpdfrc.japanese
|
||||
+include /etc/xpdf/add-to-xpdfrc.korean
|
||||
+include /etc/xpdf/add-to-xpdfrc.chinese-simplified
|
||||
+include /etc/xpdf/add-to-xpdfrc.chinese-traditional
|
||||
diff -up xpdf-3.04/doc/xpdfrc.5.orig xpdf-3.04/doc/xpdfrc.5
|
||||
--- xpdf-3.04/doc/xpdfrc.5.orig 2014-05-28 14:50:50.000000000 -0400
|
||||
+++ xpdf-3.04/doc/xpdfrc.5 2014-05-29 14:50:23.701974504 -0400
|
||||
@@ -7,7 +7,7 @@ All of the Xpdf tools read a single conf
|
||||
.I .xpdfrc
|
||||
file in your home directory, it will be read. Otherwise, a
|
||||
system-wide configuration file will be read from
|
||||
-.IR /usr/local/etc/xpdfrc ,
|
||||
+.IR /etc/xpdfrc ,
|
||||
if it exists. (This is its default location; depending on build
|
||||
options, it may be placed elsewhere.) On Win32 systems, the
|
||||
.I xpdfrc
|
||||
@@ -672,7 +672,7 @@ urlCommand "netscape \-remote 'open
|
||||
.fi
|
||||
.SH FILES
|
||||
.TP
|
||||
-.B /usr/local/etc/xpdfrc
|
||||
+.B /etc/xpdfrc
|
||||
This is the default location for the system-wide configuration file.
|
||||
Depending on build options, it may be placed elsewhere.
|
||||
.TP
|
||||
diff -up xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc.orig xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc
|
||||
--- xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc.orig 2014-05-29 14:50:23.700974511 -0400
|
||||
+++ xpdf-3.04/xpdf-chinese-simplified/add-to-xpdfrc 2014-05-29 14:53:15.316783717 -0400
|
||||
@@ -1,9 +1,9 @@
|
||||
#----- begin Chinese Simplified support package (2011-sep-02)
|
||||
-cidToUnicode Adobe-GB1 /usr/local/share/xpdf/chinese-simplified/Adobe-GB1.cidToUnicode
|
||||
-unicodeMap ISO-2022-CN /usr/local/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap
|
||||
-unicodeMap EUC-CN /usr/local/share/xpdf/chinese-simplified/EUC-CN.unicodeMap
|
||||
-unicodeMap GBK /usr/local/share/xpdf/chinese-simplified/GBK.unicodeMap
|
||||
-cMapDir Adobe-GB1 /usr/local/share/xpdf/chinese-simplified/CMap
|
||||
-toUnicodeDir /usr/local/share/xpdf/chinese-simplified/CMap
|
||||
+cidToUnicode Adobe-GB1 /usr/share/xpdf/chinese-simplified/Adobe-GB1.cidToUnicode
|
||||
+unicodeMap ISO-2022-CN /usr/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap
|
||||
+unicodeMap EUC-CN /usr/share/xpdf/chinese-simplified/EUC-CN.unicodeMap
|
||||
+unicodeMap GBK /usr/share/xpdf/chinese-simplified/GBK.unicodeMap
|
||||
+cMapDir Adobe-GB1 /usr/share/xpdf/chinese-simplified/CMap
|
||||
+toUnicodeDir /usr/share/xpdf/chinese-simplified/CMap
|
||||
#fontFileCC Adobe-GB1 /usr/..../gkai00mp.ttf
|
||||
#----- end Chinese Simplified support package
|
||||
diff -up xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc.orig xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc
|
||||
--- xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc.orig 2014-05-29 14:50:23.699974518 -0400
|
||||
+++ xpdf-3.04/xpdf-chinese-traditional/add-to-xpdfrc 2014-05-29 14:53:15.321783682 -0400
|
||||
@@ -1,8 +1,8 @@
|
||||
#----- begin Chinese Traditional support package (2011-sep-02)
|
||||
-cidToUnicode Adobe-CNS1 /usr/local/share/xpdf/chinese-traditional/Adobe-CNS1.cidToUnicode
|
||||
-unicodeMap Big5 /usr/local/share/xpdf/chinese-traditional/Big5.unicodeMap
|
||||
-unicodeMap Big5ascii /usr/local/share/xpdf/chinese-traditional/Big5ascii.unicodeMap
|
||||
-cMapDir Adobe-CNS1 /usr/local/share/xpdf/chinese-traditional/CMap
|
||||
-toUnicodeDir /usr/local/share/xpdf/chinese-traditional/CMap
|
||||
+cidToUnicode Adobe-CNS1 /usr/share/xpdf/chinese-traditional/Adobe-CNS1.cidToUnicode
|
||||
+unicodeMap Big5 /usr/share/xpdf/chinese-traditional/Big5.unicodeMap
|
||||
+unicodeMap Big5ascii /usr/share/xpdf/chinese-traditional/Big5ascii.unicodeMap
|
||||
+cMapDir Adobe-CNS1 /usr/share/xpdf/chinese-traditional/CMap
|
||||
+toUnicodeDir /usr/share/xpdf/chinese-traditional/CMap
|
||||
#fontFileCC Adobe-CNS1 /usr/..../bkai00mp.ttf
|
||||
#----- end Chinese Traditional support package
|
||||
diff -up xpdf-3.04/xpdf-cyrillic/add-to-xpdfrc.orig xpdf-3.04/xpdf-cyrillic/add-to-xpdfrc
|
||||
--- xpdf-3.04/xpdf-cyrillic/add-to-xpdfrc.orig 2014-05-29 14:50:23.704974484 -0400
|
||||
+++ xpdf-3.04/xpdf-cyrillic/add-to-xpdfrc 2014-05-29 14:53:15.325783654 -0400
|
||||
@@ -1,4 +1,4 @@
|
||||
#----- begin Cyrillic support package (2011-aug-15)
|
||||
-nameToUnicode /usr/local/share/xpdf/cyrillic/Bulgarian.nameToUnicode
|
||||
-unicodeMap KOI8-R /usr/local/share/xpdf/cyrillic/KOI8-R.unicodeMap
|
||||
+nameToUnicode /usr/share/xpdf/cyrillic/Bulgarian.nameToUnicode
|
||||
+unicodeMap KOI8-R /usr/share/xpdf/cyrillic/KOI8-R.unicodeMap
|
||||
#----- end Cyrillic support package
|
||||
diff -up xpdf-3.04/xpdf-japanese/add-to-xpdfrc.orig xpdf-3.04/xpdf-japanese/add-to-xpdfrc
|
||||
--- xpdf-3.04/xpdf-japanese/add-to-xpdfrc.orig 2014-05-29 14:50:23.700974511 -0400
|
||||
+++ xpdf-3.04/xpdf-japanese/add-to-xpdfrc 2014-05-29 14:53:15.340783550 -0400
|
||||
@@ -1,9 +1,9 @@
|
||||
#----- begin Japanese support package (2011-sep-02)
|
||||
-cidToUnicode Adobe-Japan1 /usr/local/share/xpdf/japanese/Adobe-Japan1.cidToUnicode
|
||||
-unicodeMap ISO-2022-JP /usr/local/share/xpdf/japanese/ISO-2022-JP.unicodeMap
|
||||
-unicodeMap EUC-JP /usr/local/share/xpdf/japanese/EUC-JP.unicodeMap
|
||||
-unicodeMap Shift-JIS /usr/local/share/xpdf/japanese/Shift-JIS.unicodeMap
|
||||
-cMapDir Adobe-Japan1 /usr/local/share/xpdf/japanese/CMap
|
||||
-toUnicodeDir /usr/local/share/xpdf/japanese/CMap
|
||||
+cidToUnicode Adobe-Japan1 /usr/share/xpdf/japanese/Adobe-Japan1.cidToUnicode
|
||||
+unicodeMap ISO-2022-JP /usr/share/xpdf/japanese/ISO-2022-JP.unicodeMap
|
||||
+unicodeMap EUC-JP /usr/share/xpdf/japanese/EUC-JP.unicodeMap
|
||||
+unicodeMap Shift-JIS /usr/share/xpdf/japanese/Shift-JIS.unicodeMap
|
||||
+cMapDir Adobe-Japan1 /usr/share/xpdf/japanese/CMap
|
||||
+toUnicodeDir /usr/share/xpdf/japanese/CMap
|
||||
#fontFileCC Adobe-Japan1 /usr/..../kochi-mincho.ttf
|
||||
#----- end Japanese support package
|
||||
diff -up xpdf-3.04/xpdf-korean/add-to-xpdfrc.orig xpdf-3.04/xpdf-korean/add-to-xpdfrc
|
||||
--- xpdf-3.04/xpdf-korean/add-to-xpdfrc.orig 2014-05-29 14:50:23.700974511 -0400
|
||||
+++ xpdf-3.04/xpdf-korean/add-to-xpdfrc 2014-05-29 14:53:15.345783515 -0400
|
||||
@@ -1,8 +1,8 @@
|
||||
#----- begin Korean support package (2011-sep-02)
|
||||
-cidToUnicode Adobe-Korea1 /usr/local/share/xpdf/korean/Adobe-Korea1.cidToUnicode
|
||||
-unicodeMap ISO-2022-KR /usr/local/share/xpdf/korean/ISO-2022-KR.unicodeMap
|
||||
-cMapDir Adobe-Korea1 /usr/local/share/xpdf/korean/CMap
|
||||
-toUnicodeDir /usr/local/share/xpdf/korean/CMap
|
||||
+cidToUnicode Adobe-Korea1 /usr/share/xpdf/korean/Adobe-Korea1.cidToUnicode
|
||||
+unicodeMap ISO-2022-KR /usr/share/xpdf/korean/ISO-2022-KR.unicodeMap
|
||||
+cMapDir Adobe-Korea1 /usr/share/xpdf/korean/CMap
|
||||
+toUnicodeDir /usr/share/xpdf/korean/CMap
|
||||
#fontFileCC Adobe-Korea1 /usr/..../batang.ttf"
|
||||
#fontFileCC Unidocs-Korea1 /usr/..../batang.ttf"
|
||||
#----- end Korean support package
|
||||
diff -up xpdf-3.04/xpdf-thai/add-to-xpdfrc.orig xpdf-3.04/xpdf-thai/add-to-xpdfrc
|
||||
--- xpdf-3.04/xpdf-thai/add-to-xpdfrc.orig 2014-05-29 14:50:23.703974490 -0400
|
||||
+++ xpdf-3.04/xpdf-thai/add-to-xpdfrc 2014-05-29 14:53:15.355783445 -0400
|
||||
@@ -1,4 +1,4 @@
|
||||
#----- begin Thai support package (2011-aug-15)
|
||||
-nameToUnicode /usr/local/share/xpdf/thai/Thai.nameToUnicode
|
||||
-unicodeMap TIS-620 /usr/local/share/xpdf/thai/TIS-620.unicodeMap
|
||||
+nameToUnicode /usr/share/xpdf/thai/Thai.nameToUnicode
|
||||
+unicodeMap TIS-620 /usr/share/xpdf/thai/TIS-620.unicodeMap
|
||||
#----- end Thai support package
|
||||
132
xpdf-4.00-permissions.patch
Normal file
132
xpdf-4.00-permissions.patch
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
diff -up xpdf-4.00/xpdf/PDFCore.cc.permissions xpdf-4.00/xpdf/PDFCore.cc
|
||||
diff -up xpdf-4.00/xpdf/pdfimages.cc.permissions xpdf-4.00/xpdf/pdfimages.cc
|
||||
--- xpdf-4.00/xpdf/pdfimages.cc.permissions 2017-08-08 19:22:50.000000000 -0400
|
||||
+++ xpdf-4.00/xpdf/pdfimages.cc 2017-08-16 18:08:04.474032500 -0400
|
||||
@@ -4,6 +4,8 @@
|
||||
//
|
||||
// Copyright 1998-2003 Glyph & Cog, LLC
|
||||
//
|
||||
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
|
||||
+//
|
||||
//========================================================================
|
||||
|
||||
#include <aconf.h>
|
||||
@@ -126,12 +128,14 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
// check for copy permission
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
if (!doc->okToCopy()) {
|
||||
error(errNotAllowed, -1,
|
||||
"Copying of images from this document is not allowed.");
|
||||
exitCode = 3;
|
||||
goto err1;
|
||||
}
|
||||
+#endif
|
||||
|
||||
// get page range
|
||||
if (firstPage < 1)
|
||||
diff -up xpdf-4.00/xpdf/pdftohtml.cc.permissions xpdf-4.00/xpdf/pdftohtml.cc
|
||||
--- xpdf-4.00/xpdf/pdftohtml.cc.permissions 2017-08-16 18:10:36.656189850 -0400
|
||||
+++ xpdf-4.00/xpdf/pdftohtml.cc 2017-08-16 18:11:06.127445692 -0400
|
||||
@@ -137,6 +137,7 @@ int main(int argc, char *argv[]) {
|
||||
goto err1;
|
||||
}
|
||||
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
// check for copy permission
|
||||
if (!doc->okToCopy()) {
|
||||
error(errNotAllowed, -1,
|
||||
@@ -144,6 +145,7 @@ int main(int argc, char *argv[]) {
|
||||
exitCode = 3;
|
||||
goto err1;
|
||||
}
|
||||
+#endif
|
||||
|
||||
// get page range
|
||||
if (firstPage < 1) {
|
||||
diff -up xpdf-4.00/xpdf/pdftops.cc.permissions xpdf-4.00/xpdf/pdftops.cc
|
||||
--- xpdf-4.00/xpdf/pdftops.cc.permissions 2017-08-08 19:22:50.000000000 -0400
|
||||
+++ xpdf-4.00/xpdf/pdftops.cc 2017-08-16 18:08:04.475032475 -0400
|
||||
@@ -4,6 +4,8 @@
|
||||
//
|
||||
// Copyright 1996-2003 Glyph & Cog, LLC
|
||||
//
|
||||
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
|
||||
+//
|
||||
//========================================================================
|
||||
|
||||
#include <aconf.h>
|
||||
@@ -321,12 +323,14 @@ int main(int argc, char *argv[]) {
|
||||
goto err1;
|
||||
}
|
||||
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
// check for print permission
|
||||
if (!doc->okToPrint()) {
|
||||
error(errNotAllowed, -1, "Printing this document is not allowed.");
|
||||
exitCode = 3;
|
||||
goto err1;
|
||||
}
|
||||
+#endif
|
||||
|
||||
// construct PostScript file name
|
||||
if (argc == 3) {
|
||||
diff -up xpdf-4.00/xpdf/pdftotext.cc.permissions xpdf-4.00/xpdf/pdftotext.cc
|
||||
--- xpdf-4.00/xpdf/pdftotext.cc.permissions 2017-08-08 19:22:50.000000000 -0400
|
||||
+++ xpdf-4.00/xpdf/pdftotext.cc 2017-08-16 18:08:04.475032475 -0400
|
||||
@@ -4,6 +4,8 @@
|
||||
//
|
||||
// Copyright 1997-2013 Glyph & Cog, LLC
|
||||
//
|
||||
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
|
||||
+//
|
||||
//========================================================================
|
||||
|
||||
#include <aconf.h>
|
||||
@@ -198,6 +200,7 @@ int main(int argc, char *argv[]) {
|
||||
goto err2;
|
||||
}
|
||||
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
// check for copy permission
|
||||
if (!doc->okToCopy()) {
|
||||
error(errNotAllowed, -1,
|
||||
@@ -205,6 +208,7 @@ int main(int argc, char *argv[]) {
|
||||
exitCode = 3;
|
||||
goto err2;
|
||||
}
|
||||
+#endif
|
||||
|
||||
// construct text file name
|
||||
if (argc == 3) {
|
||||
diff -up xpdf-4.00/xpdf-qt/QtPDFCore.cc.permissions xpdf-4.00/xpdf-qt/QtPDFCore.cc
|
||||
--- xpdf-4.00/xpdf-qt/QtPDFCore.cc.permissions 2017-08-16 18:09:45.169489907 -0400
|
||||
+++ xpdf-4.00/xpdf-qt/QtPDFCore.cc 2017-08-16 18:10:14.375752439 -0400
|
||||
@@ -429,9 +429,11 @@ QString QtPDFCore::getSelectedTextQStrin
|
||||
QChar c;
|
||||
int i;
|
||||
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
if (!doc->okToCopy()) {
|
||||
return "";
|
||||
}
|
||||
+#endif
|
||||
if (!(s = getSelectedText())) {
|
||||
return "";
|
||||
}
|
||||
diff -up xpdf-4.00/xpdf-qt/XpdfWidget.cc.permissions xpdf-4.00/xpdf-qt/XpdfWidget.cc
|
||||
--- xpdf-4.00/xpdf-qt/XpdfWidget.cc.permissions 2017-08-16 18:12:40.775055809 -0400
|
||||
+++ xpdf-4.00/xpdf-qt/XpdfWidget.cc 2017-08-16 18:12:45.835928020 -0400
|
||||
@@ -1399,7 +1399,11 @@ bool XpdfWidget::okToExtractText() const
|
||||
if (!core->getDoc()) {
|
||||
return false;
|
||||
}
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
return (bool)core->getDoc()->okToCopy();
|
||||
+#else
|
||||
+ return true;
|
||||
+#endif
|
||||
} catch (GMemException e) {
|
||||
return false;
|
||||
}
|
||||
27
xpdf-4.00-versionedlib.patch
Normal file
27
xpdf-4.00-versionedlib.patch
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
diff -up xpdf-4.00/fofi/CMakeLists.txt.versionedlib xpdf-4.00/fofi/CMakeLists.txt
|
||||
--- xpdf-4.00/fofi/CMakeLists.txt.versionedlib 2017-08-08 19:22:50.000000000 -0400
|
||||
+++ xpdf-4.00/fofi/CMakeLists.txt 2017-08-16 20:06:18.106884951 -0400
|
||||
@@ -24,3 +24,5 @@ add_library(fofi_objs OBJECT
|
||||
add_library(fofi
|
||||
$<TARGET_OBJECTS:fofi_objs>
|
||||
)
|
||||
+
|
||||
+set_target_properties(fofi PROPERTIES VERSION 4 SOVERSION 4)
|
||||
diff -up xpdf-4.00/goo/CMakeLists.txt.versionedlib xpdf-4.00/goo/CMakeLists.txt
|
||||
--- xpdf-4.00/goo/CMakeLists.txt.versionedlib 2017-08-08 19:22:50.000000000 -0400
|
||||
+++ xpdf-4.00/goo/CMakeLists.txt 2017-08-16 20:06:00.525277924 -0400
|
||||
@@ -25,3 +25,5 @@ add_library(goo_objs OBJECT
|
||||
add_library(goo
|
||||
$<TARGET_OBJECTS:goo_objs>
|
||||
)
|
||||
+
|
||||
+set_target_properties(goo PROPERTIES VERSION 4 SOVERSION 4)
|
||||
diff -up xpdf-4.00/splash/CMakeLists.txt.versionedlib xpdf-4.00/splash/CMakeLists.txt
|
||||
--- xpdf-4.00/splash/CMakeLists.txt.versionedlib 2017-08-08 19:22:50.000000000 -0400
|
||||
+++ xpdf-4.00/splash/CMakeLists.txt 2017-08-16 20:06:41.204368689 -0400
|
||||
@@ -44,4 +44,5 @@ if (HAVE_SPLASH)
|
||||
add_library(splash
|
||||
$<TARGET_OBJECTS:splash_objs>
|
||||
)
|
||||
+ set_target_properties(splash PROPERTIES VERSION 4 SOVERSION 4)
|
||||
endif ()
|
||||
60
xpdf-4.01-64bit.patch
Normal file
60
xpdf-4.01-64bit.patch
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
diff -up xpdf-4.01/goo/gmem.cc.alloc xpdf-4.01/goo/gmem.cc
|
||||
--- xpdf-4.01/goo/gmem.cc.alloc 2019-02-18 13:24:19.000000000 -0500
|
||||
+++ xpdf-4.01/goo/gmem.cc 2019-02-22 09:37:02.683498383 -0500
|
||||
@@ -84,8 +84,8 @@ static size_t gMaxMemInUse = 0;
|
||||
#endif /* DEBUG_MEM */
|
||||
|
||||
#ifdef DEBUG_MEM
|
||||
-void *gmalloc(int size, int ignore) GMEM_EXCEP {
|
||||
- int size1;
|
||||
+void *gmalloc(size_t size, int ignore) GMEM_EXCEP {
|
||||
+ size_t size1;
|
||||
char *mem;
|
||||
GMemHdr *hdr;
|
||||
void *data;
|
||||
@@ -134,7 +134,7 @@ void *gmalloc(int size, int ignore) GMEM
|
||||
return data;
|
||||
}
|
||||
#else
|
||||
-void *gmalloc(int size) GMEM_EXCEP {
|
||||
+void *gmalloc(size_t size) GMEM_EXCEP {
|
||||
void *p;
|
||||
|
||||
if (size < 0) {
|
||||
@@ -150,11 +150,11 @@ void *gmalloc(int size) GMEM_EXCEP {
|
||||
}
|
||||
#endif
|
||||
|
||||
-void *grealloc(void *p, int size) GMEM_EXCEP {
|
||||
+void *grealloc(void *p, size_t size) GMEM_EXCEP {
|
||||
#ifdef DEBUG_MEM
|
||||
GMemHdr *hdr;
|
||||
void *q;
|
||||
- int oldSize;
|
||||
+ size_t oldSize;
|
||||
|
||||
if (size < 0) {
|
||||
gMemError("Invalid memory allocation size");
|
||||
diff -up xpdf-4.01/goo/gmem.h.alloc xpdf-4.01/goo/gmem.h
|
||||
--- xpdf-4.01/goo/gmem.h.alloc 2019-02-18 13:24:19.000000000 -0500
|
||||
+++ xpdf-4.01/goo/gmem.h 2019-02-22 09:37:02.683498383 -0500
|
||||
@@ -37,16 +37,16 @@ extern "C" {
|
||||
* returns NULL.
|
||||
*/
|
||||
#ifdef DEBUG_MEM
|
||||
-extern void *gmalloc(int size, int ignore = 0) GMEM_EXCEP;
|
||||
+extern void *gmalloc(size_t size, int ignore = 0) GMEM_EXCEP;
|
||||
#else
|
||||
-extern void *gmalloc(int size) GMEM_EXCEP;
|
||||
+extern void *gmalloc(size_t size) GMEM_EXCEP;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Same as realloc, but prints error message and exits if realloc()
|
||||
* returns NULL. If <p> is NULL, calls malloc instead of realloc().
|
||||
*/
|
||||
-extern void *grealloc(void *p, int size) GMEM_EXCEP;
|
||||
+extern void *grealloc(void *p, size_t size) GMEM_EXCEP;
|
||||
|
||||
/*
|
||||
* These are similar to gmalloc and grealloc, but take an object count
|
||||
21
xpdf-4.01-crash.patch
Normal file
21
xpdf-4.01-crash.patch
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
diff -up xpdf-4.01/fofi/FoFiType1.cc.crash xpdf-4.01/fofi/FoFiType1.cc
|
||||
--- xpdf-4.01/fofi/FoFiType1.cc.crash 2019-02-22 09:33:55.304458147 -0500
|
||||
+++ xpdf-4.01/fofi/FoFiType1.cc 2019-02-22 09:36:30.966169469 -0500
|
||||
@@ -276,9 +276,14 @@ void FoFiType1::parse() {
|
||||
p += 3;
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
37
xpdf-4.01-ext.patch
Normal file
37
xpdf-4.01-ext.patch
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
diff -up xpdf-4.01/goo/gfile.cc.ext xpdf-4.01/goo/gfile.cc
|
||||
--- xpdf-4.01/goo/gfile.cc.ext 2019-02-18 13:24:19.000000000 -0500
|
||||
+++ xpdf-4.01/goo/gfile.cc 2019-02-22 09:33:17.023259251 -0500
|
||||
@@ -473,24 +473,6 @@ GBool openTempFile(GString **name, FILE
|
||||
char *s;
|
||||
int fd;
|
||||
|
||||
- if (ext) {
|
||||
-#if HAVE_MKSTEMPS
|
||||
- if ((s = getenv("TMPDIR"))) {
|
||||
- *name = new GString(s);
|
||||
- } else {
|
||||
- *name = new GString("/tmp");
|
||||
- }
|
||||
- (*name)->append("/XXXXXX")->append(ext);
|
||||
- fd = mkstemps((*name)->getCString(), (int)strlen(ext));
|
||||
-#else
|
||||
- if (!(s = tmpnam(NULL))) {
|
||||
- return gFalse;
|
||||
- }
|
||||
- *name = new GString(s);
|
||||
- (*name)->append(ext);
|
||||
- fd = open((*name)->getCString(), O_WRONLY | O_CREAT | O_EXCL, 0600);
|
||||
-#endif
|
||||
- } else {
|
||||
#if HAVE_MKSTEMP
|
||||
if ((s = getenv("TMPDIR"))) {
|
||||
*name = new GString(s);
|
||||
@@ -506,7 +488,7 @@ GBool openTempFile(GString **name, FILE
|
||||
*name = new GString(s);
|
||||
fd = open((*name)->getCString(), O_WRONLY | O_CREAT | O_EXCL, 0600);
|
||||
#endif // HAVE_MKSTEMP
|
||||
- }
|
||||
+
|
||||
if (fd < 0 || !(*f = fdopen(fd, mode))) {
|
||||
delete *name;
|
||||
*name = NULL;
|
||||
55
xpdf-4.01-urw-base35-fonts.patch
Normal file
55
xpdf-4.01-urw-base35-fonts.patch
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
diff -up xpdf-4.01/xpdf/GlobalParams.cc.urw-font-fix xpdf-4.01/xpdf/GlobalParams.cc
|
||||
--- xpdf-4.01/xpdf/GlobalParams.cc.urw-font-fix 2019-02-18 13:24:19.000000000 -0500
|
||||
+++ xpdf-4.01/xpdf/GlobalParams.cc 2019-02-22 09:44:56.842457771 -0500
|
||||
@@ -79,20 +79,20 @@ static struct {
|
||||
const char *obliqueFont; // name of font to oblique
|
||||
double obliqueFactor; // oblique sheer factor
|
||||
} displayFontTab[] = {
|
||||
- {"Courier", "n022003l.pfb", "cour.ttf", "Courier", "Courier", NULL, 0},
|
||||
- {"Courier-Bold", "n022004l.pfb", "courbd.ttf", "Courier", "Courier Bold", NULL, 0},
|
||||
- {"Courier-BoldOblique", "n022024l.pfb", "courbi.ttf", "Courier", "Courier Bold Oblique", "Courier-Bold", 0.212557},
|
||||
- {"Courier-Oblique", "n022023l.pfb", "couri.ttf", "Courier", "Courier Oblique", "Courier", 0.212557},
|
||||
- {"Helvetica", "n019003l.pfb", "arial.ttf", "Helvetica", "Helvetica", NULL, 0},
|
||||
- {"Helvetica-Bold", "n019004l.pfb", "arialbd.ttf", "Helvetica", "Helvetica-Bold", NULL, 0},
|
||||
- {"Helvetica-BoldOblique", "n019024l.pfb", "arialbi.ttf", "Helvetica", "Helvetica Bold Oblique", "Helvetica-Bold", 0.212557},
|
||||
- {"Helvetica-Oblique", "n019023l.pfb", "ariali.ttf", "Helvetica", "Helvetica Oblique", "Helvetica", 0.212557},
|
||||
- {"Symbol", "s050000l.pfb", NULL, "Symbol", "Symbol", NULL, 0},
|
||||
- {"Times-Bold", "n021004l.pfb", "timesbd.ttf", "Times", "Times-Bold", NULL, 0},
|
||||
- {"Times-BoldItalic", "n021024l.pfb", "timesbi.ttf", "Times", "Times-BoldItalic", NULL, 0},
|
||||
- {"Times-Italic", "n021023l.pfb", "timesi.ttf", "Times", "Times-Italic", NULL, 0},
|
||||
- {"Times-Roman", "n021003l.pfb", "times.ttf", "Times", "Times-Roman", NULL, 0},
|
||||
- {"ZapfDingbats", "d050000l.pfb", NULL, "ZapfDingbats", "Zapf Dingbats", NULL, 0},
|
||||
+ {"Courier", "NimbusMonoPS-Regular.t1", "cour.ttf", "Courier", "Courier", NULL, 0},
|
||||
+ {"Courier-Bold", "NimbusMonoPS-Bold.t1", "courbd.ttf", "Courier", "Courier Bold", NULL, 0},
|
||||
+ {"Courier-BoldOblique", "NimbusMonoPS-BoldItalic.t1", "courbi.ttf", "Courier", "Courier Bold Oblique", "Courier-Bold", 0.212557},
|
||||
+ {"Courier-Oblique", "NimbusMonoPS-Italic.t1", "couri.ttf", "Courier", "Courier Oblique", "Courier", 0.212557},
|
||||
+ {"Helvetica", "NimbusSans-Regular.t1", "arial.ttf", "Helvetica", "Helvetica", NULL, 0},
|
||||
+ {"Helvetica-Bold", "NimbusSans-Bold.t1", "arialbd.ttf", "Helvetica", "Helvetica-Bold", NULL, 0},
|
||||
+ {"Helvetica-BoldOblique", "NimbusSans-BoldItalic.t1", "arialbi.ttf", "Helvetica", "Helvetica Bold Oblique", "Helvetica-Bold", 0.212557},
|
||||
+ {"Helvetica-Oblique", "NimbusSans-Italic.t1", "ariali.ttf", "Helvetica", "Helvetica Oblique", "Helvetica", 0.212557},
|
||||
+ {"Symbol", "StandardSymbolsPS.t1", NULL, "Symbol", "Symbol", NULL, 0},
|
||||
+ {"Times-Bold", "NimbusRoman-Bold.t1", "timesbd.ttf", "Times", "Times-Bold", NULL, 0},
|
||||
+ {"Times-BoldItalic", "NimbusRoman-BoldItalic.t1", "timesbi.ttf", "Times", "Times-BoldItalic", NULL, 0},
|
||||
+ {"Times-Italic", "NimbusRoman-Italic.t1", "timesi.ttf", "Times", "Times-Italic", NULL, 0},
|
||||
+ {"Times-Roman", "NimbusRoman-Regular.t1", "times.ttf", "Times", "Times-Roman", NULL, 0},
|
||||
+ {"ZapfDingbats", "D050000L.t1", NULL, "ZapfDingbats", "Zapf Dingbats", NULL, 0},
|
||||
{NULL}
|
||||
};
|
||||
|
||||
@@ -104,6 +104,7 @@ static const char *displayFontDirs[] = {
|
||||
};
|
||||
#else
|
||||
static const char *displayFontDirs[] = {
|
||||
+ "/usr/share/fonts/urw-base35",
|
||||
"/usr/share/ghostscript/fonts",
|
||||
"/usr/local/share/ghostscript/fonts",
|
||||
"/usr/share/fonts/default/Type1",
|
||||
@@ -2204,7 +2205,7 @@ UnicodeRemapping *GlobalParams::getUnico
|
||||
}
|
||||
|
||||
GString *GlobalParams::findFontFile(GString *fontName) {
|
||||
- static const char *exts[] = { ".pfa", ".pfb", ".ttf", ".ttc", ".otf" };
|
||||
+ static const char *exts[] = { ".pfa", ".pfb", ".t1", ".ttf", ".ttc", ".otf" };
|
||||
GString *path, *dir;
|
||||
#ifdef _WIN32
|
||||
GString *fontNameU;
|
||||
79
xpdf-4.02-CVE-2019-12360.patch
Normal file
79
xpdf-4.02-CVE-2019-12360.patch
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
diff -up xpdf-4.02/fofi/FoFiTrueType.cc.CVE-2019-12360 xpdf-4.02/fofi/FoFiTrueType.cc
|
||||
--- xpdf-4.02/fofi/FoFiTrueType.cc.CVE-2019-12360 2020-06-26 15:15:48.156850534 -0400
|
||||
+++ xpdf-4.02/fofi/FoFiTrueType.cc 2020-06-26 15:15:35.204068577 -0400
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "gtypes.h"
|
||||
#include "gmem.h"
|
||||
#include "gmempp.h"
|
||||
+#include "GLikely.h"
|
||||
#include "GString.h"
|
||||
#include "GHash.h"
|
||||
#include "FoFiType1C.h"
|
||||
@@ -1764,7 +1765,7 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFu
|
||||
GBool ok;
|
||||
Guint checksum;
|
||||
int nNewTables;
|
||||
- int glyfTableLen, length, pos, glyfPos, i, j, k;
|
||||
+ int glyfTableLen, length, pos, glyfPos, i, j, k, vmtxTabLength;
|
||||
Guchar vheaTab[36] = {
|
||||
0, 1, 0, 0, // table version number
|
||||
0, 0, // ascent
|
||||
@@ -1891,6 +1892,7 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFu
|
||||
}
|
||||
}
|
||||
vmtxTab = NULL; // make gcc happy
|
||||
+ vmtxTabLength = 0;
|
||||
advance = 0; // make gcc happy
|
||||
if (needVerticalMetrics) {
|
||||
needVhea = seekTable("vhea") < 0;
|
||||
@@ -1951,6 +1953,7 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFu
|
||||
checksum = computeTableChecksum(vheaTab, length);
|
||||
} else if (needVerticalMetrics && i == t42VmtxTable) {
|
||||
length = 4 + (nGlyphs - 1) * 2;
|
||||
+ vmtxTabLength = length;
|
||||
vmtxTab = (Guchar *)gmalloc(length);
|
||||
vmtxTab[0] = (Guchar)(advance / 256);
|
||||
vmtxTab[1] = (Guchar)(advance % 256);
|
||||
@@ -2065,8 +2068,16 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFu
|
||||
dumpString(file + tables[j].offset, tables[j].len,
|
||||
outputFunc, outputStream);
|
||||
} else if (needVerticalMetrics && i == t42VheaTable) {
|
||||
+ if (unlikely(length > (int)sizeof(vheaTab))) {
|
||||
+ //~ error(errSyntaxWarning, -1, "length bigger than vheaTab size");
|
||||
+ length = sizeof(vheaTab);
|
||||
+ }
|
||||
dumpString(vheaTab, length, outputFunc, outputStream);
|
||||
} else if (needVerticalMetrics && i == t42VmtxTable) {
|
||||
+ if (unlikely(length > vmtxTabLength)) {
|
||||
+ //~ error(errSyntaxWarning, -1, "length bigger than vmtxTab size");
|
||||
+ length = vmtxTabLength;
|
||||
+ }
|
||||
dumpString(vmtxTab, length, outputFunc, outputStream);
|
||||
}
|
||||
}
|
||||
diff -up xpdf-4.02/goo/GLikely.h.CVE-2019-12360 xpdf-4.02/goo/GLikely.h
|
||||
--- xpdf-4.02/goo/GLikely.h.CVE-2019-12360 2020-06-26 15:11:32.839149675 -0400
|
||||
+++ xpdf-4.02/goo/GLikely.h 2020-06-26 15:11:07.713572773 -0400
|
||||
@@ -0,0 +1,22 @@
|
||||
+//========================================================================
|
||||
+//
|
||||
+// GLikely.h
|
||||
+//
|
||||
+// This file is licensed under the GPLv2 or later
|
||||
+//
|
||||
+// Copyright (C) 2008 Kees Cook <kees@outflux.net>
|
||||
+//
|
||||
+//========================================================================
|
||||
+
|
||||
+#ifndef GLIKELY_H
|
||||
+#define GLIKELY_H
|
||||
+
|
||||
+#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
|
||||
+# define likely(x) __builtin_expect((x), 1)
|
||||
+# define unlikely(x) __builtin_expect((x), 0)
|
||||
+#else
|
||||
+# define likely(x) (x)
|
||||
+# define unlikely(x) (x)
|
||||
+#endif
|
||||
+
|
||||
+#endif
|
||||
19
xpdf-4.02-CVE-2019-17064.patch
Normal file
19
xpdf-4.02-CVE-2019-17064.patch
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
diff -up xpdf-4.02/xpdf/Catalog.cc.CVE-2019-17064 xpdf-4.02/xpdf/Catalog.cc
|
||||
--- xpdf-4.02/xpdf/Catalog.cc.CVE-2019-17064 2019-12-02 12:21:54.480562087 -0500
|
||||
+++ xpdf-4.02/xpdf/Catalog.cc 2019-12-02 12:22:37.047605136 -0500
|
||||
@@ -159,6 +159,7 @@ Catalog::Catalog(PDFDoc *docA) {
|
||||
baseURI = NULL;
|
||||
form = NULL;
|
||||
embeddedFiles = NULL;
|
||||
+ pageLabels = NULL;
|
||||
#if MULTITHREADED
|
||||
gInitMutex(&pageMutex);
|
||||
#endif
|
||||
@@ -241,7 +242,6 @@ Catalog::Catalog(PDFDoc *docA) {
|
||||
// get the ViewerPreferences object
|
||||
catDict.dictLookupNF("ViewerPreferences", &viewerPrefs);
|
||||
|
||||
- pageLabels = NULL;
|
||||
if (catDict.dictLookup("PageLabels", &obj)->isDict()) {
|
||||
readPageLabelTree(&obj);
|
||||
}
|
||||
12
xpdf-4.04-GlobalParams-null-fix.patch
Normal file
12
xpdf-4.04-GlobalParams-null-fix.patch
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
diff -up xpdf-4.04/xpdf/GlobalParams.h.null-fix xpdf-4.04/xpdf/GlobalParams.h
|
||||
--- xpdf-4.04/xpdf/GlobalParams.h.null-fix 2023-01-30 14:10:42.286805370 -0500
|
||||
+++ xpdf-4.04/xpdf/GlobalParams.h 2023-01-30 14:10:50.383895185 -0500
|
||||
@@ -237,7 +237,7 @@ public:
|
||||
|
||||
// Initialize the global parameters by attempting to read a config
|
||||
// file.
|
||||
- GlobalParams(const char *cfgFileName);
|
||||
+ GlobalParams(const char *cfgFileName = NULL);
|
||||
|
||||
~GlobalParams();
|
||||
|
||||
17
xpdf-4.04-shared-xpdf-lib.patch
Normal file
17
xpdf-4.04-shared-xpdf-lib.patch
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
diff -up xpdf-4.04/xpdf/CMakeLists.txt.shared-xpdf-lib xpdf-4.04/xpdf/CMakeLists.txt
|
||||
--- xpdf-4.04/xpdf/CMakeLists.txt.shared-xpdf-lib 2023-01-30 14:30:07.185779720 -0500
|
||||
+++ xpdf-4.04/xpdf/CMakeLists.txt 2023-01-30 14:31:41.942842314 -0500
|
||||
@@ -78,6 +78,13 @@ add_library(xpdf_objs OBJECT
|
||||
set_property(TARGET xpdf_objs
|
||||
PROPERTY POSITION_INDEPENDENT_CODE True)
|
||||
|
||||
+add_library(xpdfcore
|
||||
+ $<TARGET_OBJECTS:xpdf_objs>
|
||||
+)
|
||||
+
|
||||
+set_target_properties(xpdfcore PROPERTIES VERSION 4 SOVERSION 4)
|
||||
+
|
||||
+
|
||||
#--- object files needed by XpdfWidget
|
||||
|
||||
if ((QT4_FOUND OR Qt5Widgets_FOUND OR Qt6Widgets_FOUND)
|
||||
22
xpdf-4.05-CVE-2024-4141.patch
Normal file
22
xpdf-4.05-CVE-2024-4141.patch
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
diff -up xpdf-4.05/fofi/FoFiType1.cc.CVE-2024-4141 xpdf-4.05/fofi/FoFiType1.cc
|
||||
--- xpdf-4.05/fofi/FoFiType1.cc.CVE-2024-4141 2024-05-29 10:19:51.918225689 -0400
|
||||
+++ xpdf-4.05/fofi/FoFiType1.cc 2024-05-29 10:20:53.406160594 -0400
|
||||
@@ -193,7 +193,8 @@ void FoFiType1::parse() {
|
||||
char *line, *line1, *p, *p2;
|
||||
char buf[256];
|
||||
char c;
|
||||
- int n, code, base, i, j;
|
||||
+ unsigned int code;
|
||||
+ int n, base, i, j;
|
||||
GBool gotMatrix, startsWithDup, endsWithDup;
|
||||
|
||||
gotMatrix = gFalse;
|
||||
@@ -262,7 +263,7 @@ void FoFiType1::parse() {
|
||||
}
|
||||
++p;
|
||||
for (p2 = p; *p2 && *p2 != ' ' && *p2 != '\t'; ++p2) ;
|
||||
- if (code >= 0 && code < 256) {
|
||||
+ if (code < 256) {
|
||||
c = *p2;
|
||||
*p2 = '\0';
|
||||
gfree(encoding[code]);
|
||||
131
xpdf-4.06-permissions.patch
Normal file
131
xpdf-4.06-permissions.patch
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
diff -up xpdf-4.06/xpdf/pdfimages.cc.permissions xpdf-4.06/xpdf/pdfimages.cc
|
||||
--- xpdf-4.06/xpdf/pdfimages.cc.permissions 2025-11-13 17:08:30.000000000 -0500
|
||||
+++ xpdf-4.06/xpdf/pdfimages.cc 2025-11-18 15:27:00.093784988 -0500
|
||||
@@ -4,6 +4,8 @@
|
||||
//
|
||||
// Copyright 1998-2003 Glyph & Cog, LLC
|
||||
//
|
||||
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
|
||||
+//
|
||||
//========================================================================
|
||||
|
||||
#include <aconf.h>
|
||||
@@ -153,12 +155,14 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
// check for copy permission
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
if (!listOnly && !doc->okToCopy()) {
|
||||
error(errNotAllowed, -1,
|
||||
"Copying of images from this document is not allowed.");
|
||||
exitCode = 3;
|
||||
goto err1;
|
||||
}
|
||||
+#endif
|
||||
|
||||
// get page range
|
||||
if (firstPage < 1)
|
||||
diff -up xpdf-4.06/xpdf/pdftohtml.cc.permissions xpdf-4.06/xpdf/pdftohtml.cc
|
||||
--- xpdf-4.06/xpdf/pdftohtml.cc.permissions 2025-11-13 17:08:30.000000000 -0500
|
||||
+++ xpdf-4.06/xpdf/pdftohtml.cc 2025-11-18 15:25:43.149122766 -0500
|
||||
@@ -183,6 +183,7 @@ int main(int argc, char *argv[]) {
|
||||
goto err1;
|
||||
}
|
||||
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
// check for copy permission
|
||||
if (!doc->okToCopy()) {
|
||||
error(errNotAllowed, -1,
|
||||
@@ -190,6 +191,7 @@ int main(int argc, char *argv[]) {
|
||||
exitCode = 3;
|
||||
goto err1;
|
||||
}
|
||||
+#endif
|
||||
|
||||
// get page range
|
||||
if (firstPage < 1) {
|
||||
diff -up xpdf-4.06/xpdf/pdftops.cc.permissions xpdf-4.06/xpdf/pdftops.cc
|
||||
--- xpdf-4.06/xpdf/pdftops.cc.permissions 2025-11-13 17:08:30.000000000 -0500
|
||||
+++ xpdf-4.06/xpdf/pdftops.cc 2025-11-18 15:25:43.149260566 -0500
|
||||
@@ -4,6 +4,8 @@
|
||||
//
|
||||
// Copyright 1996-2003 Glyph & Cog, LLC
|
||||
//
|
||||
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
|
||||
+//
|
||||
//========================================================================
|
||||
|
||||
#include <aconf.h>
|
||||
@@ -337,12 +339,14 @@ int main(int argc, char *argv[]) {
|
||||
goto err1;
|
||||
}
|
||||
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
// check for print permission
|
||||
if (!doc->okToPrint()) {
|
||||
error(errNotAllowed, -1, "Printing this document is not allowed.");
|
||||
exitCode = 3;
|
||||
goto err1;
|
||||
}
|
||||
+#endif
|
||||
|
||||
// construct PostScript file name
|
||||
if (argc == 3) {
|
||||
diff -up xpdf-4.06/xpdf/pdftotext.cc.permissions xpdf-4.06/xpdf/pdftotext.cc
|
||||
--- xpdf-4.06/xpdf/pdftotext.cc.permissions 2025-11-13 17:08:30.000000000 -0500
|
||||
+++ xpdf-4.06/xpdf/pdftotext.cc 2025-11-18 15:25:43.149380451 -0500
|
||||
@@ -4,6 +4,8 @@
|
||||
//
|
||||
// Copyright 1997-2013 Glyph & Cog, LLC
|
||||
//
|
||||
+// Modified for Debian by Hamish Moffatt, 22 May 2002.
|
||||
+//
|
||||
//========================================================================
|
||||
|
||||
#include <aconf.h>
|
||||
@@ -248,6 +250,7 @@ int main(int argc, char *argv[]) {
|
||||
goto err2;
|
||||
}
|
||||
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
// check for copy permission
|
||||
if (!doc->okToCopy()) {
|
||||
error(errNotAllowed, -1,
|
||||
@@ -255,6 +258,7 @@ int main(int argc, char *argv[]) {
|
||||
exitCode = 3;
|
||||
goto err2;
|
||||
}
|
||||
+#endif
|
||||
|
||||
// construct text file name
|
||||
if (argc == 3) {
|
||||
diff -up xpdf-4.06/xpdf-qt/QtPDFCore.cc.permissions xpdf-4.06/xpdf-qt/QtPDFCore.cc
|
||||
--- xpdf-4.06/xpdf-qt/QtPDFCore.cc.permissions 2025-11-13 17:08:30.000000000 -0500
|
||||
+++ xpdf-4.06/xpdf-qt/QtPDFCore.cc 2025-11-18 15:25:43.149536859 -0500
|
||||
@@ -494,9 +494,11 @@ QString QtPDFCore::getSelectedTextQStrin
|
||||
QString qs;
|
||||
int i;
|
||||
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
if (!doc->okToCopy()) {
|
||||
return "";
|
||||
}
|
||||
+#endif
|
||||
if (!(s = getSelectedText())) {
|
||||
return "";
|
||||
}
|
||||
diff -up xpdf-4.06/xpdf-qt/XpdfWidget.cc.permissions xpdf-4.06/xpdf-qt/XpdfWidget.cc
|
||||
--- xpdf-4.06/xpdf-qt/XpdfWidget.cc.permissions 2025-11-13 17:08:30.000000000 -0500
|
||||
+++ xpdf-4.06/xpdf-qt/XpdfWidget.cc 2025-11-18 15:25:43.149737940 -0500
|
||||
@@ -1526,7 +1526,11 @@ bool XpdfWidget::okToExtractText() const
|
||||
if (!core->getDoc()) {
|
||||
return false;
|
||||
}
|
||||
+#ifdef ENFORCE_PERMISSIONS
|
||||
return (bool)core->getDoc()->okToCopy();
|
||||
+#else
|
||||
+ return true;
|
||||
+#endif
|
||||
} catch (GMemException e) {
|
||||
return false;
|
||||
}
|
||||
133
xpdf-4.06-urw-base35-fonts.patch
Normal file
133
xpdf-4.06-urw-base35-fonts.patch
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
diff -up xpdf-4.06/xpdf/GlobalParams.cc.urw-font-fix xpdf-4.06/xpdf/GlobalParams.cc
|
||||
--- xpdf-4.06/xpdf/GlobalParams.cc.urw-font-fix 2025-11-13 17:08:30.000000000 -0500
|
||||
+++ xpdf-4.06/xpdf/GlobalParams.cc 2025-11-18 15:23:11.114577091 -0500
|
||||
@@ -84,98 +84,98 @@ static struct {
|
||||
double obliqueFactor; // oblique sheer factor
|
||||
} displayFontTab[] = {
|
||||
{"Courier", // name
|
||||
- "n022003l.pfb", // t1FileName
|
||||
+ "NimbusMonoPS-Regular.t1", // t1FileName
|
||||
"cour.ttf", // ttFileName
|
||||
"Courier", "Courier", // macFileName, macFontName
|
||||
"NimbusMonoPS-Regular", // fcFontName
|
||||
NULL, 0 // obliqueFont, obliqueFactor
|
||||
},
|
||||
{"Courier-Bold", // name
|
||||
- "n022004l.pfb", // t1FileName
|
||||
+ "NimbusMonoPS-Bold.t1", // t1FileName
|
||||
"courbd.ttf", // ttFileName
|
||||
"Courier", "Courier Bold", // macFileName, macFontName
|
||||
"NimbusMonoPS-Bold", // fcFontName
|
||||
NULL, 0 // obliqueFont, obliqueFactor
|
||||
},
|
||||
{"Courier-BoldOblique", // name
|
||||
- "n022024l.pfb", // t1FileName
|
||||
+ "NimbusMonoPS-BoldItalic.t1", // t1FileName
|
||||
"courbi.ttf", // ttFileName
|
||||
"Courier", "Courier Bold Oblique", // macFileName, macFontName
|
||||
"NimbusMonoPS-BoldItalic", // fcFontName
|
||||
"Courier-Bold", 0.212557 // obliqueFont, obliqueFactor
|
||||
},
|
||||
{"Courier-Oblique", // name
|
||||
- "n022023l.pfb", // t1FileName
|
||||
+ "NimbusMonoPS-Italic.t1", // t1FileName
|
||||
"couri.ttf", // ttFileName
|
||||
"Courier", "Courier Oblique", // macFileName, macFontName
|
||||
"NimbusMonoPS-Italic", // fcFontName
|
||||
"Courier", 0.212557 // obliqueFont, obliqueFactor
|
||||
},
|
||||
{"Helvetica", // name
|
||||
- "n019003l.pfb", // t1FileName
|
||||
+ "NimbusSans-Regular.t1", // t1FileName
|
||||
"arial.ttf", // ttFileName
|
||||
"Helvetica", "Helvetica", // macFileName, macFontName
|
||||
"NimbusSans-Regular", // fcFontName
|
||||
NULL, 0 // obliqueFont, obliqueFactor
|
||||
},
|
||||
{"Helvetica-Bold", // name
|
||||
- "n019004l.pfb", // t1FileName
|
||||
+ "NimbusSans-Bold.t1", // t1FileName
|
||||
"arialbd.ttf", // ttFileName
|
||||
"Helvetica", "Helvetica Bold", // macFileName, macFontName
|
||||
"NimbusSans-Bold", // fcFontName
|
||||
NULL, 0 // obliqueFont, obliqueFactor
|
||||
},
|
||||
{"Helvetica-BoldOblique", // name
|
||||
- "n019024l.pfb", // t1FileName
|
||||
+ "NimbusSans-BoldItalic.t1", // t1FileName
|
||||
"arialbi.ttf", // ttFileName
|
||||
"Helvetica", "Helvetica Bold Oblique", // macFileName, macFontName
|
||||
"NimbusSans-BoldItalic", // fcFontName
|
||||
"Helvetica-Bold", 0.212557 // obliqueFont, obliqueFactor
|
||||
},
|
||||
{"Helvetica-Oblique", // name
|
||||
- "n019023l.pfb", // t1FileName
|
||||
+ "NimbusSans-Italic.t1", // t1FileName
|
||||
"ariali.ttf", // ttFileName
|
||||
"Helvetica", "Helvetica Oblique", // macFileName, macFontName
|
||||
"NimbusSans-Italic", // fcFontName
|
||||
"Helvetica", 0.212557 // obliqueFont, obliqueFactor
|
||||
},
|
||||
{"Symbol", // name
|
||||
- "s050000l.pfb", // t1FileName
|
||||
+ "StandardSymbolsPS.t1", // t1FileName
|
||||
NULL, // ttFileName
|
||||
"Symbol", "Symbol", // macFileName, macFontName
|
||||
"Standard Symbols PS", // fcFontName
|
||||
NULL, 0 // obliqueFont, obliqueFactor
|
||||
},
|
||||
{"Times-Bold", // name
|
||||
- "n021004l.pfb", // t1FileName
|
||||
+ "NimbusRoman-Bold.t1", // t1FileName
|
||||
"timesbd.ttf", // ttFileName
|
||||
"Times", "Times Bold", // macFileName, macFontName
|
||||
"NimbusRoman-Bold", // fcFontName
|
||||
NULL, 0 // obliqueFont, obliqueFactor
|
||||
},
|
||||
{"Times-BoldItalic", // name
|
||||
- "n021024l.pfb", // t1FileName
|
||||
+ "NimbusRoman-BoldItalic.t1", // t1FileName
|
||||
"timesbi.ttf", // ttFileName
|
||||
"Times", "Times Bold Italic", // macFileName, macFontName
|
||||
"NimbusRoman-BoldItalic", // fcFontName
|
||||
NULL, 0 // obliqueFont, obliqueFactor
|
||||
},
|
||||
{"Times-Italic", // name
|
||||
- "n021023l.pfb", // t1FileName
|
||||
+ "NimbusRoman-Italic.t1", // t1FileName
|
||||
"timesi.ttf", // ttFileName
|
||||
"Times", "Times Italic", // macFileName, macFontName
|
||||
"NimbusRoman-Italic", // fcFontName
|
||||
NULL, 0 // obliqueFont, obliqueFactor
|
||||
},
|
||||
{"Times-Roman", // name
|
||||
- "n021003l.pfb", // t1FileName
|
||||
+ "NimbusRoman-Regular.t1", // t1FileName
|
||||
"times.ttf", // ttFileName
|
||||
"Times", "Times Roman", // macFileName, macFontName
|
||||
"NimbusRoman-Regular", // fcFontName
|
||||
NULL, 0 // obliqueFont, obliqueFactor
|
||||
},
|
||||
{"ZapfDingbats", // name
|
||||
- "d050000l.pfb", // t1FileName
|
||||
+ "D050000L.t1", // t1FileName
|
||||
NULL, // ttFileName
|
||||
"ZapfDingbats", "Zapf Dingbats", // macFileName, macFontName
|
||||
"D050000L", // fcFontName
|
||||
@@ -192,6 +192,7 @@ static const char *displayFontDirs[] = {
|
||||
"c:/windows/fonts",
|
||||
"c:/winnt/fonts",
|
||||
#else // _WIN32
|
||||
+ "/usr/share/fonts/urw-base35",
|
||||
"/usr/share/ghostscript/fonts",
|
||||
"/usr/local/share/ghostscript/fonts",
|
||||
"/usr/share/fonts/default/Type1",
|
||||
@@ -2788,7 +2789,7 @@ UnicodeRemapping *GlobalParams::getUnico
|
||||
}
|
||||
|
||||
GString *GlobalParams::findFontFile(GString *fontName) {
|
||||
- static const char *exts[] = { ".pfa", ".pfb", ".ttf", ".ttc", ".otf" };
|
||||
+ static const char *exts[] = { ".pfa", ".pfb", ".t1", ".ttf", ".ttc", ".otf" };
|
||||
GString *path, *dir;
|
||||
#ifdef _WIN32
|
||||
GString *fontNameU;
|
||||
21
xpdf-fix-pdftopng-resolution.patch
Normal file
21
xpdf-fix-pdftopng-resolution.patch
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
--- c/xpdf/pdftopng.cc
|
||||
+++ c/xpdf/pdftopng.cc
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "SplashOutputDev.h"
|
||||
#include "config.h"
|
||||
|
||||
+#define INCHESPERMETER 39.37007874
|
||||
+
|
||||
static int firstPage = 1;
|
||||
static int lastPage = 0;
|
||||
static int resolution = 150;
|
||||
@@ -261,6 +263,9 @@ static void setupPNG(png_structp *png, png_infop *pngInfo, FILE *f,
|
||||
png_set_IHDR(*png, *pngInfo, bitmap->getWidth(), bitmap->getHeight(),
|
||||
bitDepth, colorType, PNG_INTERLACE_NONE,
|
||||
PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
|
||||
+ png_set_pHYs(*png, *pngInfo, resolution*INCHESPERMETER, resolution*INCHESPERMETER,
|
||||
+ PNG_RESOLUTION_METER);
|
||||
+
|
||||
png_write_info(*png, *pngInfo);
|
||||
}
|
||||
|
||||
14
xpdf.desktop
Normal file
14
xpdf.desktop
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
[Desktop Entry]
|
||||
Categories=Graphics;
|
||||
X-Desktop-File-Install-Version=0.2
|
||||
Name=Xpdf PDF Viewer
|
||||
Name[sv]=Xpdf PDF-visare
|
||||
Name[de]=Xpdf PDF-Betrachter
|
||||
Comment=View Adobe PDF (acrobat) files
|
||||
Comment[sv]=Visar Adobe PDF-filer (acrobat-filer)
|
||||
Comment[de]=PDF-Betrachter
|
||||
Exec=xpdf %f
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=xpdf
|
||||
MimeType=application/pdf;
|
||||
BIN
xpdf.png
Normal file
BIN
xpdf.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 654 B |
Loading…
Add table
Add a link
Reference in a new issue