From f66cfd7369b3c12cd0ed4c47c49377ed01727abd Mon Sep 17 00:00:00 2001 From: JUN FANG Date: Thu, 16 Apr 2015 15:19:04 -0700 Subject: 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 --- fpdfsdk/src/fpdfview.cpp | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) (limited to 'fpdfsdk') 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 -- cgit v1.2.3