--- xpdf/GfxFont.cc.orig 2010-05-18 11:22:18.000000000 -0700
+++ xpdf/GfxFont.cc 2010-05-18 11:22:18.000000000 -0700
+@@ -194,7 +194,7 @@
+ embFontID = obj2.getRef();
+ if (type != fontType1) {
+ error(-1, "Mismatch between font type and embedded font file");
+- type = fontType1;
++ type = isCIDFont() ? fontCIDType0 : fontType1;
+ }
+ }
+ obj2.free();
@@ -919,6 +919,10 @@
return 1;
}
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;
#endif
#include <string.h>
#include <ctype.h>
+@@ -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 @@