diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-08-17 23:09:43 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-17 23:09:43 +0000 |
commit | a9d56105a725d223f87bd979ffbf61a8a2377c08 (patch) | |
tree | e450f3e0ccf185de7c4cbccd892eac6ed6fb360d /core/fpdfapi/render/cpdf_renderstatus.h | |
parent | cffa651acfa7ca1d90aecea728e94c5c3dcdfe79 (diff) | |
download | pdfium-a9d56105a725d223f87bd979ffbf61a8a2377c08.tar.xz |
Use more UnownedPtr<> in cpdf_renderstatus.h.chromium/3526
This immediately flags a case where a pointer from a heap object to
a caller's stack object is persisted past the caller's lifetime. Fix
it the simplest way via AutoRestorer<> so we'll get a nice safe segv
should it be used.
Change-Id: I554304b235e73c279fa0cd79c9e3ee0138be45f9
Reviewed-on: https://pdfium-review.googlesource.com/40592
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/render/cpdf_renderstatus.h')
-rw-r--r-- | core/fpdfapi/render/cpdf_renderstatus.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fpdfapi/render/cpdf_renderstatus.h b/core/fpdfapi/render/cpdf_renderstatus.h index a7e845f237..f6d58843c0 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.h +++ b/core/fpdfapi/render/cpdf_renderstatus.h @@ -188,8 +188,8 @@ class CPDF_RenderStatus { CFX_RenderDevice* const m_pDevice; CFX_Matrix m_DeviceMatrix; CPDF_ClipPath m_LastClipPath; - const CPDF_PageObject* m_pCurObj = nullptr; - const CPDF_PageObject* m_pStopObj = nullptr; + UnownedPtr<const CPDF_PageObject> m_pCurObj; + UnownedPtr<const CPDF_PageObject> m_pStopObj; CPDF_GraphicStates m_InitialStates; std::unique_ptr<CPDF_ImageRenderer> m_pImageRenderer; CPDF_Transparency m_Transparency; |