From a031357eaab7c934ac03717968cf78ff556c819b Mon Sep 17 00:00:00 2001 From: weili Date: Wed, 4 May 2016 09:36:11 -0700 Subject: Reland of lax a couple checks to allow certain non-standard PDF files. (patchset #1 id:1 of https://codereview.chromium.org/1946693002/ ) Reason for revert: The culprit was found and confirmed, not this one. Original issue's description: > Revert of Relax a couple checks to allow certain non-standard PDF files. (patchset #1 id:1 of https://codereview.chromium.org/1926823002/ ) > > Reason for revert: > Speculatively revert due to high volume of crashes on Chromium. > > Original issue's description: > > Relax a couple checks to allow certain non-standard PDF files. > > > > Some non-standard PDF files misuse the size of cross reference table, > > and reuse some object number which the old one is still in use. PDFium > > can relax the reusing of xref objects only since it is not referred in > > the pdf document. When the size of cross reference table is larger > > than defined, PDFium will try to continue other than abort. > > > > BUG=chromium:596947 > > > > Committed: https://pdfium.googlesource.com/pdfium/+/cd1e9ff4f432cbc29ed279e6891fb7ddc2ea3734 > > TBR=thestig@chromium.org,dsinclair@chromium.org > # Not skipping CQ checks because original CL landed more than 1 days ago. > BUG=chromium:596947 > > Committed: https://pdfium.googlesource.com/pdfium/+/5fc4f31285c3a88fc157fd2d9b9cf2eb5c7cabed TBR=thestig@chromium.org,dsinclair@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=chromium:596947 Review-Url: https://codereview.chromium.org/1947983002 --- core/fpdfapi/fpdf_parser/cpdf_parser_embeddertest.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'core/fpdfapi/fpdf_parser/cpdf_parser_embeddertest.cpp') diff --git a/core/fpdfapi/fpdf_parser/cpdf_parser_embeddertest.cpp b/core/fpdfapi/fpdf_parser/cpdf_parser_embeddertest.cpp index 042b221554..d070bd6a4c 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_parser_embeddertest.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_parser_embeddertest.cpp @@ -54,3 +54,19 @@ TEST_F(CPDFParserEmbeddertest, Bug_602650) { FPDFText_ClosePage(text_page); UnloadPage(page); } + +TEST_F(CPDFParserEmbeddertest, Bug_596947) { + // Test the case that the size of cross reference entries doesn't match with + // what is defined, and a certain case of reuse object number for cross + // reference object. + EXPECT_TRUE(OpenDocument("bug_596947.pdf")); + FPDF_PAGE page = LoadPage(0); + EXPECT_NE(nullptr, page); + FPDF_TEXTPAGE text_page = FPDFText_LoadPage(page); + EXPECT_NE(nullptr, text_page); + // The page should not be blank. + EXPECT_LT(0, FPDFText_CountChars(text_page)); + + FPDFText_ClosePage(text_page); + UnloadPage(page); +} -- cgit v1.2.3