From e80685c12c3620c178a2286e00dd03c7886f8785 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 26 Jan 2015 16:59:09 -0800 Subject: Merge to XFA: Fix infinite recursion in CPDF_Parser::ParseIndirectObjectAt(). Orignal Review URL: https://codereview.chromium.org/875263002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/880753002 --- core/include/fxcrt/fx_basic.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'core/include/fxcrt/fx_basic.h') diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h index 1c828cea48..b63327c9c2 100644 --- a/core/include/fxcrt/fx_basic.h +++ b/core/include/fxcrt/fx_basic.h @@ -1414,6 +1414,21 @@ protected: CFX_DataFilter* m_pDestFilter; }; + +template +class CFX_AutoRestorer { +public: + explicit CFX_AutoRestorer(T* location) { + m_Location = location; + m_OldValue = *location; + } + ~CFX_AutoRestorer() { *m_Location = m_OldValue; } + +private: + T* m_Location; + T m_OldValue; +}; + template class CFX_SmartPointer { -- cgit v1.2.3