diff options
author | thestig <thestig@chromium.org> | 2016-08-09 15:46:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-09 15:46:20 -0700 |
commit | dc359b03ab6a70ee52a91119ff6704cae92f4809 (patch) | |
tree | 131cb9b1846f4be24c9cb7c54b30975c6a858071 /core/fpdfapi/fpdf_page/include/cpdf_imageobject.h | |
parent | 39ba18a64283ef3fc3c4aedf537a09835f90862e (diff) | |
download | pdfium-dc359b03ab6a70ee52a91119ff6704cae92f4809.tar.xz |
Fix a leak with FPDFPageObj_NewImgeObj().
BUG=pdfium:545
Review-Url: https://codereview.chromium.org/2194393002
Diffstat (limited to 'core/fpdfapi/fpdf_page/include/cpdf_imageobject.h')
-rw-r--r-- | core/fpdfapi/fpdf_page/include/cpdf_imageobject.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/fpdfapi/fpdf_page/include/cpdf_imageobject.h b/core/fpdfapi/fpdf_page/include/cpdf_imageobject.h index b2bffa707c..fdbd43c4a9 100644 --- a/core/fpdfapi/fpdf_page/include/cpdf_imageobject.h +++ b/core/fpdfapi/fpdf_page/include/cpdf_imageobject.h @@ -7,6 +7,8 @@ #ifndef CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_IMAGEOBJECT_H_ #define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_IMAGEOBJECT_H_ +#include <memory> + #include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" #include "core/fxcrt/include/fx_coordinates.h" @@ -27,9 +29,16 @@ class CPDF_ImageObject : public CPDF_PageObject { void CalcBoundingBox(); CPDF_Image* GetImage() const { return m_pImage; } + void SetOwnedImage(std::unique_ptr<CPDF_Image> pImage); + void SetUnownedImage(CPDF_Image* pImage); - CPDF_Image* m_pImage; CFX_Matrix m_Matrix; + + private: + void Release(); + + CPDF_Image* m_pImage; + bool m_pImageOwned; }; #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_IMAGEOBJECT_H_ |