summaryrefslogtreecommitdiff
path: root/core/src/fxge/android
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:46:16 -0700
commit01f9dfbc16da03aa4d29338aabd0ca4403234776 (patch)
treefbb338aa6e5429c78e1544c642397b75febca865 /core/src/fxge/android
parentf148faa4ddce6e967d42653c68630eb060b5d9d1 (diff)
downloadpdfium-01f9dfbc16da03aa4d29338aabd0ca4403234776.tar.xz
Merge to XFA: Fix a crashier due to incorrect type conversion
BUG=issue179 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1217093006 .
Diffstat (limited to 'core/src/fxge/android')
-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)
{