From b92ec18fdccd196035e02f3232c0b730637ac815 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Wed, 11 Apr 2018 21:55:49 +0000 Subject: Fix crash when ColorSpace references itself directly. Also fixes any problems with cycles between colorspaces. Past fixes have solved problems with CPDF_DocPageData::GetColorSpace() calling itself and CPDF_DocPageData::GetColorSpace() calling CPDF_ColorSpace::Load() and vice versa. They have not solved CPDF_ColorSpace::Load() calling itself. This CL repurposes the |pVisited| set to ensure CPDF_ColorSpace::Load() does not try to load a colorspace as a dependency of itself and creates |pVisitedLocal| to ensure CPDF_DocPageData::GetColorSpace() does not create a similar circular dependency not involving CPDF_ColorSpace::Load(). Bug: chromium:828206 Change-Id: Ib2d0ec494be169135607f3651e0f70627b26ebd7 Reviewed-on: https://pdfium-review.googlesource.com/29810 Reviewed-by: Lei Zhang Commit-Queue: Henrique Nakashima --- BUILD.gn | 1 + 1 file changed, 1 insertion(+) (limited to 'BUILD.gn') diff --git a/BUILD.gn b/BUILD.gn index 36ee859264..a51e3f4609 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -2980,6 +2980,7 @@ test("pdfium_unittests") { test("pdfium_embeddertests") { sources = [ "core/fpdfapi/edit/cpdf_creator_embeddertest.cpp", + "core/fpdfapi/page/cpdf_docpagedata_embeddertest.cpp", "core/fpdfapi/page/cpdf_stitchfunc_embeddertest.cpp", "core/fpdfapi/parser/cpdf_parser_embeddertest.cpp", "core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp", -- cgit v1.2.3