[poppler] Branch 'poppler-0.8' - 2 commits - fofi/FoFiTrueType.cc poppler/SplashOutputDev.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Mon Aug 4 11:37:03 PDT 2008
fofi/FoFiTrueType.cc | 8 +++++++-
poppler/SplashOutputDev.cc | 5 +++++
2 files changed, 12 insertions(+), 1 deletion(-)
New commits:
commit cdc086af582de4b2d734498fc04cf7e8d8178d68
Author: Albert Astals Cid <aacid at kde.org>
Date: Mon Aug 4 20:34:42 2008 +0200
Be less strict when parsing TTF tables
With this change and freetype from CVS i can render Bug 16940 using the splash renderer
diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc
index d702123..fc64be8 100644
--- a/fofi/FoFiTrueType.cc
+++ b/fofi/FoFiTrueType.cc
@@ -20,6 +20,7 @@
#include "goo/GooHash.h"
#include "FoFiType1C.h"
#include "FoFiTrueType.h"
+#include "Error.h"
//
// Terminology
@@ -1874,6 +1875,7 @@ void FoFiTrueType::parse() {
}
tables = (TrueTypeTable *)gmallocn(nTables, sizeof(TrueTypeTable));
pos += 12;
+ int wrongTables = 0;
for (i = 0; i < nTables; ++i) {
tables[i].tag = getU32BE(pos, &parsedOk);
tables[i].checksum = getU32BE(pos + 4, &parsedOk);
@@ -1881,10 +1883,14 @@ void FoFiTrueType::parse() {
tables[i].len = (int)getU32BE(pos + 12, &parsedOk);
if (tables[i].offset + tables[i].len < tables[i].offset ||
tables[i].offset + tables[i].len > len) {
- parsedOk = gFalse;
+ i--;
+ wrongTables++;
+ error(-1, "Found a bad table definition on true type definition, trying to continue...");
}
pos += 16;
}
+ nTables -= wrongTables;
+ tables = (TrueTypeTable *)greallocn(tables, nTables, sizeof(TrueTypeTable));
if (!parsedOk) {
return;
}
commit b87c9f08a3064f689a4024411f4ec6e447723f0c
Author: Albert Astals Cid <aacid at kde.org>
Date: Mon Aug 4 20:16:50 2008 +0200
Report an error when FoFiTrueType::load or FoFiTrueType::make fail
diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc
index 9fb0653..858dba6 100644
--- a/poppler/SplashOutputDev.cc
+++ b/poppler/SplashOutputDev.cc
@@ -1125,7 +1125,12 @@ void SplashOutputDev::doUpdateFont(GfxState *state) {
else
ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
if (! ff)
+ {
+ error(-1, "Couldn't create a font for '%s'",
+ gfxFont->getName() ? gfxFont->getName()->getCString()
+ : "(unnamed)");
goto err2;
+ }
codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
delete ff;
}
More information about the poppler
mailing list