From 6bebd2e3cfb7790580722836d0debab3103c94d0 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Wed, 11 Apr 2018 00:13:36 +0000 Subject: Avoid stack overflow when loading CPDF_Function. CPDF_StitchFuncs that reference each other create a Load() loop. Maintaining a set of the visited CPDF_Objects during a Load() call tree prevents that. Bug: chromium:830221 Change-Id: I6f494da16c6d79f05870ff85cff38ff8fe69ecfe Reviewed-on: https://pdfium-review.googlesource.com/30050 Commit-Queue: dsinclair Reviewed-by: dsinclair --- core/fpdfapi/page/cpdf_expintfunc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/fpdfapi/page/cpdf_expintfunc.h') diff --git a/core/fpdfapi/page/cpdf_expintfunc.h b/core/fpdfapi/page/cpdf_expintfunc.h index 867d2fa265..f46d6c2f0a 100644 --- a/core/fpdfapi/page/cpdf_expintfunc.h +++ b/core/fpdfapi/page/cpdf_expintfunc.h @@ -7,6 +7,8 @@ #ifndef CORE_FPDFAPI_PAGE_CPDF_EXPINTFUNC_H_ #define CORE_FPDFAPI_PAGE_CPDF_EXPINTFUNC_H_ +#include + #include "core/fpdfapi/page/cpdf_function.h" class CPDF_ExpIntFunc : public CPDF_Function { @@ -15,7 +17,7 @@ class CPDF_ExpIntFunc : public CPDF_Function { ~CPDF_ExpIntFunc() override; // CPDF_Function - bool v_Init(CPDF_Object* pObj) override; + bool v_Init(CPDF_Object* pObj, std::set* pVisited) override; bool v_Call(float* inputs, float* results) const override; uint32_t m_nOrigOutputs; -- cgit v1.2.3