| Index: fpdfsdk/fpdfview.cpp
|
| diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
|
| index 020ff8df6d57c8bc39d52c914b7d1754013b0cca..c79dbf9d88fe07b2e57102644a4d5ff471bfe7d4 100644
|
| --- a/fpdfsdk/fpdfview.cpp
|
| +++ b/fpdfsdk/fpdfview.cpp
|
| @@ -464,15 +464,15 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_GetFileVersion(FPDF_DOCUMENT doc,
|
| // header).
|
| DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document) {
|
| CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
|
| - if (!pDoc || !pDoc->GetParser())
|
| + if (!pDoc) {
|
| #ifndef PDF_ENABLE_XFA
|
| return 0;
|
| #else // PDF_ENABLE_XFA
|
| - return (uint32_t)-1;
|
| + return 0xFFFFFFFF;
|
| #endif // PDF_ENABLE_XFA
|
| + }
|
|
|
| - CPDF_Dictionary* pDict = pDoc->GetParser()->GetEncryptDict();
|
| - return pDict ? pDict->GetIntegerBy("P") : (uint32_t)-1;
|
| + return pDoc->GetUserPermissions();
|
| }
|
|
|
| DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document) {
|
|
|