summaryrefslogtreecommitdiff
path: root/fpdfsdk/src
diff options
context:
space:
mode:
authorJUN FANG <jun_fang@foxitsoftware.com>2015-04-16 15:19:04 -0700
committerJUN FANG <jun_fang@foxitsoftware.com>2015-04-16 15:19:04 -0700
commitf66cfd7369b3c12cd0ed4c47c49377ed01727abd (patch)
tree7aa2ca3ffd3d05c8460a2d27cec568459338a583 /fpdfsdk/src
parent81ab23b0c3c419f3dc4e6cd2012f042a40a9741e (diff)
downloadpdfium-f66cfd7369b3c12cd0ed4c47c49377ed01727abd.tar.xz
Fix heap use after free in FT_Stream_ReleaseFrame
Adjust the release order of resource to fix this issue. BUG=452793 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1082023002
Diffstat (limited to 'fpdfsdk/src')
-rw-r--r--fpdfsdk/src/fpdfview.cpp40
1 files changed, 1 insertions, 39 deletions
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 2430324f30..c9d9a25580 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -180,37 +180,7 @@ FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy)
#define _T(x) x
#endif
-#ifdef API5
- CPDF_ModuleMgr* g_pModuleMgr = NULL;
-#else
- CCodec_ModuleMgr* g_pCodecModule = NULL;
-#endif
-
-//extern CPDFSDK_FormFillApp* g_pFormFillApp;
-
-#if _FX_OS_ == _FX_LINUX_EMBEDDED_
-class CFontMapper : public IPDF_FontMapper
-{
-public:
- CFontMapper();
- virtual ~CFontMapper();
-
- virtual FT_Face FindSubstFont(
- CPDF_Document* pDoc, // [IN] The PDF document
- const CFX_ByteString& face_name, // [IN] Original name
- FX_BOOL bTrueType, // [IN] TrueType or Type1
- FX_DWORD flags, // [IN] PDF font flags (see PDF Reference section 5.7.1)
- int font_weight, // [IN] original font weight. 0 for not specified
- int CharsetCP, // [IN] code page for charset (see Win32 GetACP())
- FX_BOOL bVertical,
- CPDF_SubstFont* pSubstFont // [OUT] Subst font data
- );
-
- FT_Face m_SysFace;
-};
-
-CFontMapper* g_pFontMapper = NULL;
-#endif // #if _FX_OS_ == _FX_LINUX_EMBEDDED_
+CCodec_ModuleMgr* g_pCodecModule = NULL;
DLLEXPORT void STDCALL FPDF_InitLibrary()
{
@@ -232,17 +202,9 @@ DLLEXPORT void STDCALL FPDF_InitLibrary()
DLLEXPORT void STDCALL FPDF_DestroyLibrary()
{
FPDFXFA_ReleaseApp();
-
-#if _FX_OS_ == _FX_LINUX_EMBEDDED_
- if (g_pFontMapper) delete g_pFontMapper;
-#endif
-#ifdef API5
- g_pModuleMgr->Destroy();
-#else
CPDF_ModuleMgr::Destroy();
CFX_GEModule::Destroy();
g_pCodecModule->Destroy();
-#endif
}
#ifndef _WIN32