summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJUN FANG <jun_fang@foxitsoftware.com>2015-07-13 04:20:10 -0700
committerJUN FANG <jun_fang@foxitsoftware.com>2015-07-13 04:20:10 -0700
commit1f4c2f24709e0246575551cecdaa0ba83de73101 (patch)
tree071d9fe0d84a1ecf8127af440ee3976a6bb88920
parentaa575d4805bf7a9e83f00b56e38d4de39d90f95c (diff)
downloadpdfium-1f4c2f24709e0246575551cecdaa0ba83de73101.tar.xz
Fix a crashier due to incorrect type conversion
BUG=issue179 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1217093006 .
-rw-r--r--core/src/fxge/android/fpf_skiafont.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/src/fxge/android/fpf_skiafont.cpp b/core/src/fxge/android/fpf_skiafont.cpp
index 40b18864ed..2dad01057a 100644
--- a/core/src/fxge/android/fpf_skiafont.cpp
+++ b/core/src/fxge/android/fpf_skiafont.cpp
@@ -159,12 +159,13 @@ int32_t CFPF_SkiaFont::GetItalicAngle() const
FX_DWORD CFPF_SkiaFont::GetFontData(FX_DWORD dwTable, uint8_t* pBuffer, FX_DWORD dwSize)
{
if (!m_Face) {
- return FALSE;
+ return 0;
}
- if (FXFT_Load_Sfnt_Table(m_Face, dwTable, 0, pBuffer, (unsigned long*)&dwSize)) {
+ FT_ULong ulSize = pdfium::base::checked_cast<FT_ULong>(dwSize);
+ if (FXFT_Load_Sfnt_Table(m_Face, dwTable, 0, pBuffer, &ulSize)) {
return 0;
}
- return dwSize;
+ return pdfium::base::checked_cast<FX_DWORD>(ulSize);
}
FX_BOOL CFPF_SkiaFont::InitFont(CFPF_SkiaFontMgr *pFontMgr, CFPF_SkiaFontDescriptor *pFontDes, const CFX_ByteStringC& bsFamily, FX_DWORD dwStyle, uint8_t uCharset)
{