summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_image.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-01-30 17:38:00 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-30 17:38:00 +0000
commite563e8352139e4852a955e319023b09f2844aee9 (patch)
treea323757e674ebab8ee7da05c169435e1062d1c26 /core/fpdfapi/page/cpdf_image.h
parent1917cdd8c90b977772cdee16cf496e56dce1a2ad (diff)
downloadpdfium-e563e8352139e4852a955e319023b09f2844aee9.tar.xz
Use UnownedPtr instead of T* in MaybeOwned.
Always check the liftime in the unowned case. Doing so unearthed the following issues: Transient lifetime issue in jbig2_image when doing realloc(). Stale (but unused) dictionary pointer in CPDF_Image. Destruction order in error branch in cpdf_dibsource.cpp Change-Id: I12b758aafeefedc7abe1e8b21a18db959929e95f Reviewed-on: https://pdfium-review.googlesource.com/24552 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_image.h')
-rw-r--r--core/fpdfapi/page/cpdf_image.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/core/fpdfapi/page/cpdf_image.h b/core/fpdfapi/page/cpdf_image.h
index 23864bbf6c..57cbe94ca2 100644
--- a/core/fpdfapi/page/cpdf_image.h
+++ b/core/fpdfapi/page/cpdf_image.h
@@ -29,7 +29,6 @@ class CPDF_Image : public Retainable {
void ConvertStreamToIndirectObject();
- CPDF_Dictionary* GetInlineDict() const { return m_pDict.Get(); }
CPDF_Stream* GetStream() const { return m_pStream.Get(); }
CPDF_Dictionary* GetDict() const;
CPDF_Dictionary* GetOC() const { return m_pOC.Get(); }
@@ -68,7 +67,7 @@ class CPDF_Image : public Retainable {
CPDF_Image(CPDF_Document* pDoc, uint32_t dwStreamObjNum);
~CPDF_Image() override;
- void FinishInitialization();
+ void FinishInitialization(CPDF_Dictionary* pStreamDict);
std::unique_ptr<CPDF_Dictionary> InitJPEG(uint8_t* pData, uint32_t size);
int32_t m_Height = 0;
@@ -78,7 +77,6 @@ class CPDF_Image : public Retainable {
bool m_bInterpolate = false;
UnownedPtr<CPDF_Document> const m_pDocument;
MaybeOwned<CPDF_Stream> m_pStream;
- MaybeOwned<CPDF_Dictionary> m_pDict;
UnownedPtr<CPDF_Dictionary> m_pOC;
};