summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-12 13:39:16 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-12 13:39:16 +0000
commit82c730bf83c7582d360fc4080c7729115b0a9550 (patch)
treefa80b3021fe06074fcd676e55195ca45f74ebfd1
parent909c6e7d2623f76dee27502d693f8b4fbb8b7649 (diff)
downloadpdfium-82c730bf83c7582d360fc4080c7729115b0a9550.tar.xz
Make empty document always have empty privileges
This landed earlier as part of a larger change that got reverted for unrelated reasons. Now re-land it by itself. See https://pdfium-review.googlesource.com/c/pdfium/+/33370 If we don't have a document, then we can't dynamically tell if it is an XFA doc, so there's no reason to believe it should have all permissions. If there is an XFA doc under the covers, then the extension will give us the value. Change-Id: I6e007ab659914c39d2e5f3fe7a25d9d13439d358 Reviewed-on: https://pdfium-review.googlesource.com/34932 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
-rw-r--r--fpdfsdk/fpdf_view.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp
index 535f1e5036..cbbfd9c71d 100644
--- a/fpdfsdk/fpdf_view.cpp
+++ b/fpdfsdk/fpdf_view.cpp
@@ -308,16 +308,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDF_GetFileVersion(FPDF_DOCUMENT doc,
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDF_GetDocPermissions(FPDF_DOCUMENT document) {
CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
- // https://bugs.chromium.org/p/pdfium/issues/detail?id=499
- if (!pDoc) {
-#ifndef PDF_ENABLE_XFA
- return 0;
-#else // PDF_ENABLE_XFA
- return 0xFFFFFFFF;
-#endif // PDF_ENABLE_XFA
- }
-
- return pDoc->GetUserPermissions();
+ return pDoc ? pDoc->GetUserPermissions() : 0;
}
FPDF_EXPORT int FPDF_CALLCONV