diff options
author | dsinclair <dsinclair@chromium.org> | 2016-10-03 13:02:27 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-03 13:02:27 -0700 |
commit | bcf46238b4533a9da91f4fa5d7248bbc85511dbd (patch) | |
tree | 755c25e5ffcf6eec6461097e0d4d366bde65a7c8 /fpdfsdk/fpdfview.cpp | |
parent | d61f958385be285f3f3897ef3a3f010048608f1c (diff) | |
download | pdfium-bcf46238b4533a9da91f4fa5d7248bbc85511dbd.tar.xz |
Guard against double deletion of page views.
This CL adds a |IsBeingDestroyed| flag into the CPDFSDK_PageView. We then
bail out of the pageview removal code early if the flag is set.
BUG=chromium:652103
Review-Url: https://codereview.chromium.org/2384243002
Diffstat (limited to 'fpdfsdk/fpdfview.cpp')
-rw-r--r-- | fpdfsdk/fpdfview.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index 5c5532e024..e48c2e9eb1 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -670,6 +670,10 @@ DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page) { CPDFSDK_PageView* pPageView = static_cast<CPDFSDK_PageView*>(pPage->GetView()); if (pPageView) { + // We're already destroying the pageview, so bail early. + if (pPageView->IsBeingDestroyed()) + return; + if (pPageView->IsLocked()) { pPageView->TakePageOwnership(); return; |