summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-11-09 14:47:16 -0800
committerLei Zhang <thestig@chromium.org>2015-11-09 14:47:16 -0800
commit6d9979dc685e3b67b0a6d9946376e026d75d3e47 (patch)
treef9b95bb83cd889913546da6be5000e4b2d811aad /core/include
parent3388f907ecac9e7662bca3bbfdf35721ded19f26 (diff)
downloadpdfium-6d9979dc685e3b67b0a6d9946376e026d75d3e47.tar.xz
Fix a leak in CPDF_Type3Font::LoadChar().
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1408063016 .
Diffstat (limited to 'core/include')
-rw-r--r--core/include/fpdfapi/fpdf_resource.h22
1 files changed, 9 insertions, 13 deletions
diff --git a/core/include/fpdfapi/fpdf_resource.h b/core/include/fpdfapi/fpdf_resource.h
index dee15cf941..233f07c57a 100644
--- a/core/include/fpdfapi/fpdf_resource.h
+++ b/core/include/fpdfapi/fpdf_resource.h
@@ -7,6 +7,8 @@
#ifndef CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_
#define CORE_INCLUDE_FPDFAPI_FPDF_RESOURCE_H_
+#include <map>
+
#include "../fxcrt/fx_system.h"
#include "../fxge/fx_font.h"
#include "fpdf_parser.h"
@@ -360,28 +362,23 @@ class CPDF_TrueTypeFont : public CPDF_SimpleFont {
virtual FX_BOOL _Load();
virtual void LoadGlyphMap();
};
+
class CPDF_Type3Char {
public:
- CPDF_Type3Char();
-
+ // Takes ownership of |pForm|.
+ explicit CPDF_Type3Char(CPDF_Form* pForm);
~CPDF_Type3Char();
FX_BOOL LoadBitmap(CPDF_RenderContext* pContext);
- FX_BOOL m_bColored;
-
- FX_BOOL m_bPageRequired;
-
CPDF_Form* m_pForm;
-
- CFX_AffineMatrix m_ImageMatrix;
-
CFX_DIBitmap* m_pBitmap;
-
+ FX_BOOL m_bColored;
int m_Width;
-
+ CFX_AffineMatrix m_ImageMatrix;
FX_RECT m_BBox;
};
+
class CPDF_Type3Font : public CPDF_SimpleFont {
public:
CPDF_Type3Font();
@@ -410,8 +407,7 @@ class CPDF_Type3Font : public CPDF_SimpleFont {
CPDF_Dictionary* m_pCharProcs;
CPDF_Dictionary* m_pPageResources;
CPDF_Dictionary* m_pFontResources;
- CFX_MapPtrToPtr m_CacheMap;
- CFX_MapPtrToPtr m_DeletedMap;
+ std::map<FX_DWORD, CPDF_Type3Char*> m_CacheMap;
};
enum CIDSet {