summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_view.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-02 17:00:05 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-02 17:00:05 +0000
commit38cb7263a0923dd5613da24b18d3d7ef052ff5e3 (patch)
tree5aa01a15db74d196679b87cf1079817e5a3c5aa1 /fpdfsdk/fpdf_view.cpp
parent67539cecfeb140d5a77fba66446450cb9e20fb1e (diff)
downloadpdfium-38cb7263a0923dd5613da24b18d3d7ef052ff5e3.tar.xz
Remove more ifndef XFA caseschromium/3449chromium/3448
Remove FXFT_Clear_Face_External_Stream() calls, period. This would cause FT to try to free memory allocated by the caller, with potentially a different allocator. If we're leaking, msan will find it, and we can deal with it properly rather than trying to force FT to tidy after us. Always call SetView(), if we have a PDF page. At worst, the link won't be used in the XFA case. Always return 0 for the null document permissions. If we don't have a document, then we can't dynamically tell if its 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: I6e3fb589eda722786567d96288cb35f43643437b Reviewed-on: https://pdfium-review.googlesource.com/33370 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_view.cpp')
-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 91072d2f51..feffaeb71c 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