head 1.6; access; symbols OPENPKG_E1_MP_HEAD:1.5 OPENPKG_E1_MP:1.5 OPENPKG_E1_MP_2_STABLE:1.5 OPENPKG_E1_FP:1.5 OPENPKG_2_STABLE_MP:1.5 OPENPKG_2_STABLE_20061018:1.5 OPENPKG_2_STABLE_20060622:1.5 OPENPKG_2_STABLE:1.5.0.2 OPENPKG_2_STABLE_BP:1.5 OPENPKG_2_5_SOLID:1.4.0.2 OPENPKG_2_5_SOLID_BP:1.4 OPENPKG_2_4_RELEASE:1.2 OPENPKG_2_4_SOLID:1.2.0.10 OPENPKG_2_4_SOLID_BP:1.2 OPENPKG_2_3_RELEASE:1.2 OPENPKG_2_3_SOLID:1.2.0.8 OPENPKG_2_3_SOLID_BP:1.2 OPENPKG_2_2_RELEASE:1.2 OPENPKG_2_2_SOLID:1.2.0.6 OPENPKG_2_2_SOLID_BP:1.2 OPENPKG_2_1_RELEASE:1.2 OPENPKG_2_1_SOLID:1.2.0.4 OPENPKG_2_1_SOLID_BP:1.2 OPENPKG_2_0_RELEASE:1.2 OPENPKG_2_0_SOLID:1.2.0.2 OPENPKG_2_0_SOLID_BP:1.2; locks; strict; comment @# @; 1.6 date 2007.09.29.15.25.10; author cs; state dead; branches; next 1.5; commitid 6lraOemslNIg1Ezs; 1.5 date 2006.06.06.11.10.59; author rse; state Exp; branches; next 1.4; commitid 7cV8tywkJgbE2Wzr; 1.4 date 2005.08.18.07.05.28; author cs; state dead; branches; next 1.3; 1.3 date 2005.08.10.21.09.25; author cs; state Exp; branches; next 1.2; 1.2 date 2004.01.23.09.52.19; author thl; state dead; branches; next 1.1; 1.1 date 2003.11.11.20.25.25; author rse; state Exp; branches; next ; desc @@ 1.6 log @upgrading package: xpdf 3.01pl2 -> 3.02pl1 @ text @Index: splash/SplashFTFont.cc --- splash/SplashFTFont.cc.orig 2005-08-17 07:34:31 +0200 +++ splash/SplashFTFont.cc 2006-06-06 12:55:31 +0200 @@@@ -14,7 +14,8 @@@@ #include #include FT_OUTLINE_H -#include FT_INTERNAL_OBJECTS_H // needed for FT_New_Size decl +#include +#include #include "gmem.h" #include "SplashMath.h" #include "SplashGlyphBitmap.h" @@@@ -25,11 +26,11 @@@@ //------------------------------------------------------------------------ -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 @@@@ -249,7 +250,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 +261,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 +269,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 +307,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, @ 1.5 log @upgrade to vendor patchlevel 2 and fix building against latest FreeType @ text @@ 1.4 log @upgrading package: xpdf 3.00pl3 -> 3.01pl0 @ text @d1 68 a68 57 --- xpdf-3.00/xpdf/SplashOutputDev.cc +++ xpdf-3.00/xpdf/SplashOutputDev.cc @@@@ -621,16 +621,19 @@@@ } break; case fontTrueType: - if (!(ff = FoFiTrueType::load(fileName->getCString()))) { - goto err2; + if ((ff = FoFiTrueType::load(fileName->getCString()))) { + codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff); + n = 256; + delete ff; + } else { + codeToGID = NULL; + n = 0; } - codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff); - delete ff; if (!(fontFile = fontEngine->loadTrueTypeFont( id, fileName->getCString(), fileName == tmpFileName, - codeToGID, 256))) { + codeToGID, n))) { error(-1, "Couldn't create a font for '%s'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); --- xpdf-3.00/fofi/FoFiTrueType.cc +++ xpdf-3.00/fofi/FoFiTrueType.cc @@@@ -1343,6 +1343,27 @@@@ return; } + // make sure the loca table is sane (correct length and entries are + // in bounds) + i = seekTable("loca"); + if (tables[i].len < (nGlyphs + 1) * (locaFmt ? 4 : 2)) { + parsedOk = gFalse; + return; + } + for (j = 0; j <= nGlyphs; ++j) { + if (locaFmt) { + pos = (int)getU32BE(tables[i].offset + j*4, &parsedOk); + } else { + pos = getU16BE(tables[i].offset + j*2, &parsedOk); + } + if (pos < 0 || pos > len) { + parsedOk = gFalse; + } + } + if (!parsedOk) { + return; + } + // read the post table readPostTable(); if (!parsedOk) { @ 1.3 log @security patch regarding CAN-2005-2097 ("loca" table verification) @ text @@ 1.2 log @upgrading package: xpdf 2.03 -> 3.00 @ text @d1 57 a57 21 Index: xpdf/FTFont.cc --- xpdf/FTFont.cc.orig 2003-10-11 22:39:11.000000000 +0200 +++ xpdf/FTFont.cc 2003-11-11 21:21:01.000000000 +0100 @@@@ -19,7 +19,7 @@@@ #include "gmem.h" #include "freetype/ftoutln.h" #include "freetype/internal/ftobjs.h" -#if 1 //~ cff cid->gid map +#if 0 //~ cff cid->gid map #include "freetype/internal/cfftypes.h" #include "freetype/internal/tttypes.h" #endif @@@@ -676,7 +676,7 @@@@ } break; case ftFontModeCFFCharset: -#if 1 //~ cff cid->gid map +#if 0 //~ cff cid->gid map { #if FREETYPE_MAJOR == 2 && FREETYPE_MINOR == 0 CFF_Font *cff = (CFF_Font *)((TT_Face)fontFile->face)->extra.data; @ 1.1 log @fix building with latest freetype library @ text @@