diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2019-02-25 03:01:12 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2019-02-25 03:01:12 +0000 |
commit | 3112e1aed533fe7ee58dd8cba2e4cd768372dfd6 (patch) | |
tree | 02077f80cf4a13a6c571bace448a53a38a9b6768 /Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc | |
parent | 73052dd2c8e70e61b653151192fe1f000fcf626d (diff) |
xpdf-4.01
git-svn-id: svn://tug.org/texlive/trunk@50122 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc')
-rw-r--r-- | Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc index e1b8be98936..470807314a6 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Catalog.cc @@ -453,8 +453,13 @@ GBool Catalog::readPageTree(Object *catDict) { } if (topPagesObj.dictLookup("Count", &countObj)->isInt()) { numPages = countObj.getInt(); - if (numPages == 0) { - // Acrobat apparently scans the page tree if it sees a zero count + if (numPages == 0 || numPages > 50000) { + // 1. Acrobat apparently scans the page tree if it sees a zero + // count. + // 2. Absurdly large page counts result in very slow loading, + // because other code tries to fetch pages 1 through n. + // In both cases: ignore the given page count and scan the tree + // instead. numPages = countPageTree(&topPagesObj); } } else { |