[poppler] Branch 'xpdf303merge' - fofi/FoFiTrueType.cc
Carlos Garcia Campos
carlosgc at kemper.freedesktop.org
Thu Sep 1 09:30:57 PDT 2011
fofi/FoFiTrueType.cc | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 1369862ed61ef8b0f81c52fce36f6c1602d82ddb
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date: Thu Sep 1 18:27:51 2011 +0200
xpdf303: Ignore entries that have an invalid tag too
diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc
index f131fac..c132da1 100644
--- a/fofi/FoFiTrueType.cc
+++ b/fofi/FoFiTrueType.cc
@@ -1249,10 +1249,14 @@ void FoFiTrueType::writeTTF(FoFiOutputFunc outputFunc,
newTables = (TrueTypeTable *)gmallocn(nNewTables, sizeof(TrueTypeTable));
j = 0;
for (i = 0; i < nTables; ++i) {
- if (tables[i].len > 0) {
+ if (tables[i].len > 0 &&
+ (tables[i].tag & 0xe0000000) &&
+ (tables[i].tag & 0x00e00000) &&
+ (tables[i].tag & 0x0000e000) &&
+ (tables[i].tag & 0x000000e0)) {
newTables[j] = tables[i];
newTables[j].origOffset = tables[i].offset;
- if (checkRegion(tables[i].offset, newTables[i].len)) {
+ if (checkRegion(tables[i].offset, tables[i].len)) {
newTables[j].checksum =
computeTableChecksum(file + tables[i].offset, tables[i].len);
if (tables[i].tag == headTag) {
More information about the poppler
mailing list