diff options
author | Jun Fang <jun_fang@foxitsoftware.com> | 2015-11-25 11:05:58 +0800 |
---|---|---|
committer | Jun Fang <jun_fang@foxitsoftware.com> | 2015-11-25 11:05:58 +0800 |
commit | 01fe5885b4dfbd9f116fb62b7bce585c153bfa77 (patch) | |
tree | f6f47f407cff5e3a107e613a5ecc95b15d375eb5 /fpdfsdk | |
parent | 696d9faba208b0233cdfe0a43f3c6e5c90935843 (diff) | |
download | pdfium-01fe5885b4dfbd9f116fb62b7bce585c153bfa77.tar.xz |
Fix a issue that FFI_GetCurrentPageIndex always returns -1
The incorrect page index may cause a crasher in the following
procedure.
BUG=pdfium:285
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1466423004 .
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/include/fsdk_mgr.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h index a3a97984df..3fc40ba085 100644 --- a/fpdfsdk/include/fsdk_mgr.h +++ b/fpdfsdk/include/fsdk_mgr.h @@ -220,15 +220,15 @@ class CPDFDoc_Environment final { } int FFI_GetCurrentPageIndex(FPDF_DOCUMENT document) { - if (m_pInfo && m_pInfo->FFI_GetCurrentPageIndex) - m_pInfo->FFI_GetCurrentPageIndex(m_pInfo, document); - return -1; + if (!m_pInfo || !m_pInfo->FFI_GetCurrentPageIndex) { + return -1; + } + return m_pInfo->FFI_GetCurrentPageIndex(m_pInfo, document); } - int FFI_SetCurrentPage(FPDF_DOCUMENT document, int iCurPage) { + void FFI_SetCurrentPage(FPDF_DOCUMENT document, int iCurPage) { if (m_pInfo && m_pInfo->FFI_SetCurrentPage) m_pInfo->FFI_SetCurrentPage(m_pInfo, document, iCurPage); - return -1; } CFX_WideString FFI_GetAppName() const { return CFX_WideString(L"Acrobat"); } |