Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(563)

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_document.cpp

Issue 2005653002: Distinguish between user and owner passwords. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | core/fpdfapi/fpdf_parser/cpdf_parser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/cpdf_document.cpp
diff --git a/core/fpdfapi/fpdf_parser/cpdf_document.cpp b/core/fpdfapi/fpdf_parser/cpdf_document.cpp
index 79965a23bbf53cd009634a9faffff1623c87902f..230b9b0d1b1bd20224b2646987c40cef77b483ed 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_document.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_document.cpp
@@ -719,9 +719,16 @@ int CPDF_Document::RetrievePageCount() const {
return CountPages(pPages, &visited_pages);
}
-uint32_t CPDF_Document::GetUserPermissions(FX_BOOL bCheckRevision) const {
- return m_pParser ? m_pParser->GetPermissions(bCheckRevision)
- : static_cast<uint32_t>(-1);
+uint32_t CPDF_Document::GetUserPermissions() const {
+ // https://bugs.chromium.org/p/pdfium/issues/detail?id=499
+ if (!m_pParser) {
+#ifndef PDF_ENABLE_XFA
+ return 0;
+#else // PDF_ENABLE_XFA
+ return 0xFFFFFFFF;
+#endif
+ }
+ return m_pParser->GetPermissions();
}
FX_BOOL CPDF_Document::IsFormStream(uint32_t objnum, FX_BOOL& bForm) const {
« no previous file with comments | « BUILD.gn ('k') | core/fpdfapi/fpdf_parser/cpdf_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698