X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fpdf%2Fxpdf-changes.patch;h=ddbd0cdeac2f7e98d876b0a7fac546a397dabe6e;hb=20f395856f21739e79eeab275beec7a3d133d568;hp=75f89a6cc2dd66059825402d88d4c2f419cb2837;hpb=55a59a26bdceccb53576c58c0535bd31c4158c68;p=swftools.git diff --git a/lib/pdf/xpdf-changes.patch b/lib/pdf/xpdf-changes.patch index 75f89a6..ddbd0cd 100644 --- a/lib/pdf/xpdf-changes.patch +++ b/lib/pdf/xpdf-changes.patch @@ -71,15 +71,20 @@ if (!strcmp(tok3, "[")) { i = 0; while (pst->getToken(tok1, sizeof(tok1), &n1) && ---- xpdf/CoreOutputDev.cc.orig 2010-05-18 11:22:18.000000000 -0700 -+++ xpdf/CoreOutputDev.cc 2010-05-18 11:22:18.000000000 -0700 -@@ -57,5 +57,5 @@ - - void CoreOutputDev::clear() { - startDoc(NULL); -- startPage(0, NULL); -+ startPage(0, NULL, 0,0,0,0); - } +@@ -320,7 +327,13 @@ + if (code >= mapLen) { + oldLen = mapLen; + mapLen = (code + 256) & ~255; ++ Unicode *oldmap; + map = (Unicode *)greallocn(map, mapLen, sizeof(Unicode)); ++ if(!map) { ++ /* we sometimes get overflows for files trying to use 0xffffffff as charcode */ ++ map = oldmap; ++ return; ++ } + for (i = oldLen; i < mapLen; ++i) { + map[i] = 0; + } --- xpdf/Decrypt.cc.orig 2010-05-18 11:22:18.000000000 -0700 +++ xpdf/Decrypt.cc 2010-05-18 11:22:18.000000000 -0700 @@ -596,6 +596,7 @@ @@ -92,19 +97,6 @@ } --- xpdf/Gfx.cc.orig 2010-05-18 11:22:18.000000000 -0700 +++ xpdf/Gfx.cc 2010-05-18 11:22:18.000000000 -0700 -@@ -454,7 +454,11 @@ - fontChanged = gFalse; - clip = clipNone; - ignoreUndef = 0; -- out->startPage(pageNum, state); -+ if(cropBox) { -+ out->startPage(pageNum, state, cropBox->x1,cropBox->y1,cropBox->x2,cropBox->y2); -+ } else { -+ out->startPage(pageNum, state, 0,0,0,0); -+ } - out->setDefaultCTM(state->getCTM()); - out->updateAll(state); - for (i = 0; i < 6; ++i) { @@ -465,6 +469,7 @@ abortCheckCbkData = abortCheckCbkDataA; @@ -642,6 +634,19 @@ syms = (JBIG2Bitmap **)gmallocn(numSyms, sizeof(JBIG2Bitmap *)); --- xpdf/JPXStream.cc.orig 2010-05-18 11:22:18.000000000 -0700 +++ xpdf/JPXStream.cc 2010-05-18 11:22:18.000000000 -0700 +@@ -241,6 +242,12 @@ + haveCompMap = gFalse; + haveChannelDefn = gFalse; + ++ img.xSize = 0; ++ img.ySize = 0; ++ img.xOffset = 0; ++ img.yOffset = 0; ++ curX = 0; ++ curY = 0; + img.tiles = NULL; + bitBuf = 0; + bitBufLen = 0; @@ -450,6 +450,7 @@ GBool haveBPC, haveCSMode; @@ -776,15 +781,6 @@ class GString; class GfxState; -@@ -94,7 +95,7 @@ - { return gTrue; } - - // Start a page. -- virtual void startPage(int pageNum, GfxState *state) {} -+ virtual void startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2) {} - - // End a page. - virtual void endPage() {} --- xpdf/SplashFTFont.cc.orig 2010-05-18 11:22:18.000000000 -0700 +++ xpdf/SplashFTFont.cc 2010-05-18 11:22:18.000000000 -0700 @@ -46,6 +46,7 @@ @@ -937,15 +933,6 @@ #include #include "gfile.h" #include "GlobalParams.h" -@@ -702,7 +703,7 @@ - nT3Fonts = 0; - } - --void SplashOutputDev::startPage(int pageNum, GfxState *state) { -+void SplashOutputDev::startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2) { - int w, h; - double *ctm; - SplashCoord mat[6]; @@ -2646,9 +2647,9 @@ softMask = new SplashBitmap(bitmap->getWidth(), bitmap->getHeight(), @@ -960,15 +947,6 @@ tBitmap->getPixel(x, y, color); --- xpdf/SplashOutputDev.h.orig 2010-05-18 11:22:18.000000000 -0700 +++ xpdf/SplashOutputDev.h 2010-05-18 11:22:18.000000000 -0700 -@@ -70,7 +70,7 @@ - //----- initialization and control - - // Start a page. -- virtual void startPage(int pageNum, GfxState *state); -+ virtual void startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2); - - // End a page. - virtual void endPage(); @@ -196,6 +196,9 @@ virtual void setVectorAntialias(GBool vaa); #endif @@ -1038,6 +1016,56 @@ #endif #include #include +@@ -2456,6 +2460,9 @@ + // check for an EOB run + if (eobRun > 0) { + while (i <= scanInfo.lastCoeff) { ++ if(i>=64) { ++ return gFalse; ++ } + j = dctZigZag[i++]; + if (data[j] != 0) { + if ((bit = readBit()) == EOF) { +@@ -2480,6 +2487,9 @@ + if (c == 0xf0) { + k = 0; + while (k < 16) { ++ if(i>=64) { ++ return gFalse; ++ } + j = dctZigZag[i++]; + if (data[j] == 0) { + ++k; +@@ -2505,6 +2515,9 @@ + } + eobRun += 1 << j; + while (i <= scanInfo.lastCoeff) { ++ if(i>=64) { ++ return gFalse; ++ } + j = dctZigZag[i++]; + if (data[j] != 0) { + if ((bit = readBit()) == EOF) { +@@ -2527,6 +2540,9 @@ + } + k = 0; + do { ++ if(i>=64) { ++ return gFalse; ++ } + j = dctZigZag[i++]; + while (data[j] != 0) { + if ((bit = readBit()) == EOF) { +@@ -2535,6 +2551,9 @@ + if (bit) { + data[j] += 1 << scanInfo.al; + } ++ if(i>=64) { ++ return gFalse; ++ } + j = dctZigZag[i++]; + } + ++k; --- xpdf/Stream.h.orig 2010-05-18 11:22:18.000000000 -0700 +++ xpdf/Stream.h 2010-05-18 11:22:18.000000000 -0700 @@ -41,7 +41,8 @@ @@ -1050,17 +1078,6 @@ }; //------------------------------------------------------------------------ ---- xpdf/TextOutputDev.cc.orig 2010-05-18 11:22:18.000000000 -0700 -+++ xpdf/TextOutputDev.cc 2010-05-18 11:22:18.000000000 -0700 -@@ -3877,7 +3877,7 @@ - } - } - --void TextOutputDev::startPage(int pageNum, GfxState *state) { -+void TextOutputDev::startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2) { - text->startPage(state); - } - --- xpdf/TextOutputDev.h.orig 2010-05-18 11:22:18.000000000 -0700 +++ xpdf/TextOutputDev.h 2010-05-18 11:22:18.000000000 -0700 @@ -170,6 +170,7 @@ @@ -1071,15 +1088,6 @@ }; //------------------------------------------------------------------------ -@@ -578,7 +579,7 @@ - //----- initialization and control - - // Start a page. -- virtual void startPage(int pageNum, GfxState *state); -+ virtual void startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2); - - // End a page. - virtual void endPage(); --- xpdf/gfile.cc.orig 2010-05-18 11:22:18.000000000 -0700 +++ xpdf/gfile.cc 2010-05-18 11:22:18.000000000 -0700 @@ -439,6 +439,52 @@