summaryrefslogtreecommitdiff
path: root/Build/source/libs/xpdf
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2010-12-01 08:45:38 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2010-12-01 08:45:38 +0000
commit5d07f14f1a5a1b5c3b8e9a3673da1c8630ccbaa5 (patch)
tree7d2361f53b2d1d0492c61992fbac95e8395ddcb3 /Build/source/libs/xpdf
parent251a6aef2c94f8bf06fcd411b0ead05d34a3d3c8 (diff)
xpdf bug fix, backported from poppler, mail from Thanh
git-svn-id: svn://tug.org/texlive/trunk@20625 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/xpdf')
-rw-r--r--Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog7
-rw-r--r--Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-60-bug-fix42
-rw-r--r--Build/source/libs/xpdf/xpdf-3.02/xpdf/CharCodeToUnicode.cc16
3 files changed, 61 insertions, 4 deletions
diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog
index a38af8df520..c6fe4548d78 100644
--- a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog
+++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/ChangeLog
@@ -1,3 +1,10 @@
+2010-12-01 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-60-bug-fix (new): Bug fix for 4-digit bfrange values in
+ ToUnicode CMap; backport from poppler-0.14.5.
+ Mail from Thanh Han The, Wed, 1 Dec 2010 08:57:29, ref:
+ http://sarovar.org/tracker/index.php?func=detail&aid=4321&group_id=106&atid=493
+
2010-10-25 Peter Breitenlohner <peb@mppmu.mpg.de>
* patch-05-pl5 (new): Official 3.02pl5 patch plus change of
diff --git a/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-60-bug-fix b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-60-bug-fix
new file mode 100644
index 00000000000..1ff057a8f53
--- /dev/null
+++ b/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-60-bug-fix
@@ -0,0 +1,42 @@
+ Bug fix, backport from poppler-0.14.5
+
+diff -ur -N xpdf-3.02.orig/xpdf/CharCodeToUnicode.cc xpdf-3.02/xpdf/CharCodeToUnicode.cc
+--- xpdf-3.02.orig/xpdf/CharCodeToUnicode.cc 2007-02-27 23:05:52.000000000 +0100
++++ xpdf-3.02/xpdf/CharCodeToUnicode.cc 2010-12-01 09:25:41.108613277 +0100
+@@ -5,6 +5,9 @@
+ // Copyright 2001-2003 Glyph & Cog, LLC
+ //
+ //========================================================================
++// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
++// See top-level ChangeLog for a list of all modifications
++//========================================================================
+
+ #include <aconf.h>
+
+@@ -243,8 +246,11 @@
+ }
+ if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' &&
+ tok2[0] == '<' && tok2[n2 - 1] == '>')) {
+- error(-1, "Illegal entry in bfchar block in ToUnicode CMap");
+- continue;
++ if (!(n1 == 4 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' && tok1[1] == '0' && tok1[2] == '0' &&
++ tok2[0] == '<' && tok2[n2 - 1] == '>')) {
++ error(-1, "Illegal entry in bfchar block in ToUnicode CMap");
++ continue;
++ }
+ }
+ tok1[n1 - 1] = tok2[n2 - 1] = '\0';
+ if (sscanf(tok1 + 1, "%x", &code1) != 1) {
+@@ -266,8 +272,10 @@
+ error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
+ break;
+ }
+- if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' &&
+- n2 == 2 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>')) {
++ if (!(((n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>') ||
++ (n1 == 4 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' && tok1[1] == '0' && tok1[2] == '0')) &&
++ ((n2 == 2 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>') ||
++ (n2 == 4 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>' && tok1[1] == '0' && tok1[2] == '0')))) {
+ error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
+ continue;
+ }
diff --git a/Build/source/libs/xpdf/xpdf-3.02/xpdf/CharCodeToUnicode.cc b/Build/source/libs/xpdf/xpdf-3.02/xpdf/CharCodeToUnicode.cc
index 3702a16d5a5..e62f9b5aa88 100644
--- a/Build/source/libs/xpdf/xpdf-3.02/xpdf/CharCodeToUnicode.cc
+++ b/Build/source/libs/xpdf/xpdf-3.02/xpdf/CharCodeToUnicode.cc
@@ -5,6 +5,9 @@
// Copyright 2001-2003 Glyph & Cog, LLC
//
//========================================================================
+// Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
+// See top-level ChangeLog for a list of all modifications
+//========================================================================
#include <aconf.h>
@@ -243,8 +246,11 @@ void CharCodeToUnicode::parseCMap1(int (*getCharFunc)(void *), void *data,
}
if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' &&
tok2[0] == '<' && tok2[n2 - 1] == '>')) {
- error(-1, "Illegal entry in bfchar block in ToUnicode CMap");
- continue;
+ if (!(n1 == 4 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' && tok1[1] == '0' && tok1[2] == '0' &&
+ tok2[0] == '<' && tok2[n2 - 1] == '>')) {
+ error(-1, "Illegal entry in bfchar block in ToUnicode CMap");
+ continue;
+ }
}
tok1[n1 - 1] = tok2[n2 - 1] = '\0';
if (sscanf(tok1 + 1, "%x", &code1) != 1) {
@@ -266,8 +272,10 @@ void CharCodeToUnicode::parseCMap1(int (*getCharFunc)(void *), void *data,
error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
break;
}
- if (!(n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' &&
- n2 == 2 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>')) {
+ if (!(((n1 == 2 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>') ||
+ (n1 == 4 + nDigits && tok1[0] == '<' && tok1[n1 - 1] == '>' && tok1[1] == '0' && tok1[2] == '0')) &&
+ ((n2 == 2 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>') ||
+ (n2 == 4 + nDigits && tok2[0] == '<' && tok2[n2 - 1] == '>' && tok1[1] == '0' && tok1[2] == '0')))) {
error(-1, "Illegal entry in bfrange block in ToUnicode CMap");
continue;
}