summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfview.cpp
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-09-24 10:49:52 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-09-24 10:49:52 -0700
commitfacd0157ce975158da1659fb58a16c1308bd553b (patch)
treeb3100d2df0b64e62169ab51aaf3bbbff008996e9 /fpdfsdk/src/fpdfview.cpp
parent0c53324519762525e17ebbacc02cd33f7f1c837d (diff)
downloadpdfium-facd0157ce975158da1659fb58a16c1308bd553b.tar.xz
Lock page in LoadFXAnnot to prevent unintended page closing
BUG=410326 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/594403003
Diffstat (limited to 'fpdfsdk/src/fpdfview.cpp')
-rw-r--r--fpdfsdk/src/fpdfview.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 49dabe300b..bd49862e1c 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -5,6 +5,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../include/fsdk_define.h"
+#include "../include/fsdk_mgr.h"
#include "../include/fpdfview.h"
#include "../include/fsdk_rendercontext.h"
#include "../include/fpdf_progressive.h"
@@ -591,6 +592,11 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page,
DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page)
{
if (!page) return;
+ CPDFSDK_PageView* pPageView = (CPDFSDK_PageView*)(((CPDF_Page*)page))->GetPrivateData((FX_LPVOID)page);
+ if (pPageView && pPageView->IsLocked()) {
+ pPageView->TakeOverPage();
+ return;
+ }
delete (CPDF_Page*)page;
}