summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_stitchfunc.h
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-04-11 00:13:36 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-11 00:13:36 +0000
commit6bebd2e3cfb7790580722836d0debab3103c94d0 (patch)
treecb8096e419b61d4b6aa6214ac7779f672d0761d9 /core/fpdfapi/page/cpdf_stitchfunc.h
parent486f39568b6f336b4e6c81300ee9caae54ebdff2 (diff)
downloadpdfium-6bebd2e3cfb7790580722836d0debab3103c94d0.tar.xz
Avoid stack overflow when loading CPDF_Function.chromium/3395
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 <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_stitchfunc.h')
-rw-r--r--core/fpdfapi/page/cpdf_stitchfunc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/fpdfapi/page/cpdf_stitchfunc.h b/core/fpdfapi/page/cpdf_stitchfunc.h
index 69e5e41041..11396f12d7 100644
--- a/core/fpdfapi/page/cpdf_stitchfunc.h
+++ b/core/fpdfapi/page/cpdf_stitchfunc.h
@@ -8,6 +8,7 @@
#define CORE_FPDFAPI_PAGE_CPDF_STITCHFUNC_H_
#include <memory>
+#include <set>
#include <vector>
#include "core/fpdfapi/page/cpdf_function.h"
@@ -18,7 +19,7 @@ class CPDF_StitchFunc : public CPDF_Function {
~CPDF_StitchFunc() override;
// CPDF_Function
- bool v_Init(CPDF_Object* pObj) override;
+ bool v_Init(CPDF_Object* pObj, std::set<CPDF_Object*>* pVisited) override;
bool v_Call(float* inputs, float* results) const override;
const std::vector<std::unique_ptr<CPDF_Function>>& GetSubFunctions() const {