diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-01-29 18:02:20 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-01-29 18:02:20 -0800 |
commit | 14b2bb0adcd723a463140929cbd9453a799a34e6 (patch) | |
tree | a50085210476a07059eb2467a69b3f2f7cdcdfa5 /core/src/fpdfapi/fpdf_render/render_int.h | |
parent | 1d43e82efde0ddbad4a3e32d860a597c3bb6ab83 (diff) | |
download | pdfium-14b2bb0adcd723a463140929cbd9453a799a34e6.tar.xz |
Fix infinite recursion in CPDF_RenderStatus::RenderSingleObject().
Introduce a local static to track the recursion depth, thereby removing
the burden for callers to track and pass a level parameter correctly through
all call paths. Also increase the depth tolerated, since we know there
were paths that were under-counting this value.
BUG=451265
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/868253009
Diffstat (limited to 'core/src/fpdfapi/fpdf_render/render_int.h')
-rw-r--r-- | core/src/fpdfapi/fpdf_render/render_int.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/src/fpdfapi/fpdf_render/render_int.h b/core/src/fpdfapi/fpdf_render/render_int.h index 81feb5eb88..bd7d375837 100644 --- a/core/src/fpdfapi/fpdf_render/render_int.h +++ b/core/src/fpdfapi/fpdf_render/render_int.h @@ -92,7 +92,7 @@ class CPDF_RenderStatus : public CFX_Object public: CPDF_RenderStatus(); ~CPDF_RenderStatus(); - FX_BOOL Initialize(int level, class CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pDeviceMatrix, + FX_BOOL Initialize(class CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pDeviceMatrix, const CPDF_PageObject* pStopObj, const CPDF_RenderStatus* pParentStatus, const CPDF_GraphicStates* pInitialStates, const CPDF_RenderOptions* pOptions, int transparency, FX_BOOL bDropObjects, CPDF_Dictionary* pFormResource = NULL, @@ -155,8 +155,11 @@ protected: void DitherObjectArea(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device); FX_BOOL GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bLogical, FX_RECT &rect) const; void GetScaledMatrix(CFX_Matrix &matrix) const; + protected: - int m_Level; + static const int kRenderMaxRecursionDepth = 64; + static int s_CurrentRecursionDepth; + CFX_RenderDevice* m_pDevice; CFX_AffineMatrix m_DeviceMatrix; CPDF_ClipPath m_LastClipPath; |