summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_transformpage_embeddertest.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-06-08 18:05:58 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-08 18:05:58 +0000
commit76d01feaeec421ebe6005f22de85998220703dd2 (patch)
treebf6333d06b3834849ceb82ad97ccf0ad2054040d /fpdfsdk/fpdf_transformpage_embeddertest.cpp
parentd8a8f2785144f6656cd84c82c865eed62885d36b (diff)
downloadpdfium-76d01feaeec421ebe6005f22de85998220703dd2.tar.xz
Do not crash if FPDFPage_Get{Media,Crop}Box() gets a NULL out parameter.
Change-Id: I4b61d4c7239caaf6081bcba80cc0d8ad61569474 Reviewed-on: https://pdfium-review.googlesource.com/34590 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_transformpage_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdf_transformpage_embeddertest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_transformpage_embeddertest.cpp b/fpdfsdk/fpdf_transformpage_embeddertest.cpp
index d064efee0b..1ebd0f054c 100644
--- a/fpdfsdk/fpdf_transformpage_embeddertest.cpp
+++ b/fpdfsdk/fpdf_transformpage_embeddertest.cpp
@@ -66,6 +66,16 @@ TEST_F(FPDFTransformEmbedderTest, GetBoundingBoxes) {
EXPECT_EQ(60, cropbox_right);
EXPECT_EQ(60, cropbox_top);
+ EXPECT_FALSE(FPDFPage_GetCropBox(page, nullptr, &cropbox_bottom,
+ &cropbox_right, &cropbox_top));
+ EXPECT_FALSE(FPDFPage_GetCropBox(page, &cropbox_left, nullptr,
+ &cropbox_right, &cropbox_top));
+ EXPECT_FALSE(FPDFPage_GetCropBox(page, &cropbox_left, &cropbox_bottom,
+ nullptr, &cropbox_top));
+ EXPECT_FALSE(FPDFPage_GetCropBox(page, &cropbox_left, &cropbox_bottom,
+ &cropbox_right, nullptr));
+ EXPECT_FALSE(FPDFPage_GetCropBox(page, nullptr, nullptr, nullptr, nullptr));
+
UnloadPage(page);
}
}