poppler/Catalog.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
New commits: commit 55dd6024a4672a1787e8b1a8276bd78fff94e2cd Author: Ilya Gorenbein <[email protected]> Date: Wed Nov 4 22:07:18 2009 +0100 Do not error on files without "Count" and "Kids" It is not spec compliant not to have those fields but Adobe Reader and FoxIt seems to allow it so try to behave like them. See bug 24720 to see why one would want such file diff --git a/poppler/Catalog.cc b/poppler/Catalog.cc index 9a18e24..37a1062 100644 --- a/poppler/Catalog.cc +++ b/poppler/Catalog.cc @@ -22,6 +22,7 @@ // Copyright (C) 2006, 2008 Carlos Garcia Campos <[email protected]> // Copyright (C) 2007 Julien Rebetez <[email protected]> // Copyright (C) 2008 Pino Toscano <[email protected]> +// Copyright (C) 2009 Ilya Gorenbein <[email protected]> // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -99,9 +100,10 @@ Catalog::Catalog(XRef *xrefA) { if (!obj.isNum()) { error(-1, "Page count in top-level pages object is wrong type (%s)", obj.getTypeName()); - goto err3; + pagesSize = numPages0 = 0; + } else { + pagesSize = numPages0 = (int)obj.getNum(); } - pagesSize = numPages0 = (int)obj.getNum(); obj.free(); pages = (Page **)gmallocn(pagesSize, sizeof(Page *)); pageRefs = (Ref *)gmallocn(pagesSize, sizeof(Ref)); @@ -216,8 +218,6 @@ Catalog::Catalog(XRef *xrefA) { catDict.free(); return; - err3: - obj.free(); err2: pagesDict.free(); err1: @@ -292,7 +292,7 @@ int Catalog::readPageTree(Dict *pagesDict, PageAttrs *attrs, int start, if (!kids.isArray()) { error(-1, "Kids object (page %d) is wrong type (%s)", start+1, kids.getTypeName()); - goto err1; + return start; } for (i = 0; i < kids.arrayGetLength(); ++i) { kids.arrayGetNF(i, &kidRef); _______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
