diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc index 2758206..718dbe7 100644 --- a/poppler/PDFDoc.cc +++ b/poppler/PDFDoc.cc @@ -1234,6 +1234,8 @@ void PDFDoc::markObject (Object* obj, XRef *xRef, XRef *countRef, Guint numOffse } else { XRefEntry *entry = countRef->getEntry(obj->getRef().num + numOffset); entry->gen++; + if (entry->gen > 9) + break; } Object obj1; getXRef()->fetch(obj->getRef().num, obj->getRef().gen, &obj1); diff --git a/utils/pdfseparate.cc b/utils/pdfseparate.cc index 9e62705..c412c7c 100644 --- a/utils/pdfseparate.cc +++ b/utils/pdfseparate.cc @@ -17,6 +17,7 @@ #include "goo/GooString.h" #include "PDFDoc.h" #include "ErrorCodes.h" +#include "GlobalParams.h" static int firstPage = 0; static int lastPage = 0; @@ -107,7 +108,9 @@ main (int argc, char *argv[]) exitCode = 0; goto err0; } + globalParams = new GlobalParams(); extractPages (argv[1], argv[2]); + delete globalParams; err0: diff --git a/utils/pdfunite.cc b/utils/pdfunite.cc index 3b3d2bb..dbaf68f 100644 --- a/utils/pdfunite.cc +++ b/utils/pdfunite.cc @@ -12,6 +12,7 @@ #include "config.h" #include #include +#include "GlobalParams.h" static GBool printVersion = gFalse; static GBool printHelp = gFalse; @@ -67,6 +68,7 @@ int main (int argc, char *argv[]) } exitCode = 0; + globalParams = new GlobalParams(); for (i = 1; i < argc - 1; i++) { GooString *gfileName = new GooString(argv[i]); PDFDoc *doc = new PDFDoc(gfileName, NULL, NULL, NULL); @@ -172,5 +174,6 @@ int main (int argc, char *argv[]) delete countRef; for (j = 0; j < (int) pages.size (); j++) pages[j].free(); for (i = 0; i < (int) docs.size (); i++) delete docs[i]; + delete globalParams; return exitCode; }