summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_view.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-07-13 18:46:21 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-13 18:46:21 +0000
commitc8a235ba4d42b67fa1bfe5f7c0dd872a3b72fc5f (patch)
treee88652ba4645872b98cca53beaa93ff611f0d790 /fpdfsdk/fpdf_view.cpp
parent3a83fe5cf6cf1c056118531105359fc31615dc7f (diff)
downloadpdfium-c8a235ba4d42b67fa1bfe5f7c0dd872a3b72fc5f.tar.xz
Validate out-parameters in FPDF_GetPageSizeByIndex().
Change-Id: I2927ebdf0aff31193ad69dcd5542f3858ffdd6ee Reviewed-on: https://pdfium-review.googlesource.com/37790 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_view.cpp')
-rw-r--r--fpdfsdk/fpdf_view.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp
index 8aca6fb9f1..5fdc82af73 100644
--- a/fpdfsdk/fpdf_view.cpp
+++ b/fpdfsdk/fpdf_view.cpp
@@ -920,6 +920,9 @@ FPDF_EXPORT int FPDF_CALLCONV FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document,
int page_index,
double* width,
double* height) {
+ if (!width || !height)
+ return false;
+
auto* pDoc = CPDFDocumentFromFPDFDocument(document);
if (!pDoc)
return false;