summaryrefslogtreecommitdiff
path: root/xfa/fde/css/cfde_cssdeclaration.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-02-27 17:08:28 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-02-28 13:58:23 +0000
commita11ac1bedef8c7a55b7e35ec89f5bdcbfcdc5025 (patch)
tree1b9fcddfa49697f90a5090bbc701a60639b05ee0 /xfa/fde/css/cfde_cssdeclaration.h
parent8f2fa901ed692f95a134b2bed6a0af3ec14e06df (diff)
downloadpdfium-a11ac1bedef8c7a55b7e35ec89f5bdcbfcdc5025.tar.xz
Avoid crash above CFWL_ListItem::GetText()
The issue at hand is caused by a raw pointer rather than a retained pointer in InheritedData::m_pFontFamily. But the larger issue is that it's bad to Get() raw pointers from these, especially when its so cheap to pass them by const reference. One reason to Get() a raw pointer is to aid in down-casts, so add a helper to CFX_RetainPtr to give us downcasted retained pointers. BUG=pdfium:665 Change-Id: Ic8624af09664ff603de2e1fda8dbde0cf889f80d Reviewed-on: https://pdfium-review.googlesource.com/2871 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fde/css/cfde_cssdeclaration.h')
-rw-r--r--xfa/fde/css/cfde_cssdeclaration.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/xfa/fde/css/cfde_cssdeclaration.h b/xfa/fde/css/cfde_cssdeclaration.h
index 7d61675bea..eb287308f8 100644
--- a/xfa/fde/css/cfde_cssdeclaration.h
+++ b/xfa/fde/css/cfde_cssdeclaration.h
@@ -34,7 +34,8 @@ class CFDE_CSSDeclaration {
CFDE_CSSDeclaration();
~CFDE_CSSDeclaration();
- CFDE_CSSValue* GetProperty(FDE_CSSProperty eProperty, bool& bImportant) const;
+ CFX_RetainPtr<CFDE_CSSValue> GetProperty(FDE_CSSProperty eProperty,
+ bool* bImportant) const;
const_prop_iterator begin() const { return properties_.begin(); }
const_prop_iterator end() const { return properties_.end(); }