summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-27 13:33:26 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-27 13:33:26 -0700
commit596d3445356b3ed009d45cde8448c7fd2d9644fe (patch)
treebd2c1bbee645956ea0897f586dea8df183b6ef43 /core/src/fpdfapi
parent6714cd8dd3327c0352f3d1fd03433692ff83b07f (diff)
downloadpdfium-596d3445356b3ed009d45cde8448c7fd2d9644fe.tar.xz
Merge to XFA: SEGV in CFX_BaseSegmentedArray::Iterate().
Original Review URL: https://codereview.chromium.org/1110653002 R=thestig@chromium.org TBR=thestig@chromium.org BUG=481363 Review URL: https://codereview.chromium.org/1110763002
Diffstat (limited to 'core/src/fpdfapi')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp3
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp5
2 files changed, 8 insertions, 0 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
index 86db177ad7..64be24c1ed 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
@@ -438,6 +438,9 @@ public:
FX_BOOL CPDF_LabCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
{
CPDF_Dictionary* pDict = pArray->GetDict(1);
+ if (!pDict) {
+ return FALSE;
+ }
CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
int i;
for (i = 0; i < 3; i ++) {
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp
index 838c4316de..e00887ff5f 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp
@@ -13,3 +13,8 @@ TEST_F(FPDFParserEmbeddertest, LoadError_454695) {
EXPECT_TRUE(OpenDocument("testing/resources/bug_454695.pdf"));
}
+TEST_F(FPDFParserEmbeddertest, Bug_481363) {
+ // Test colorspace object with malformed dictionary.
+ EXPECT_TRUE(OpenDocument("testing/resources/bug_481363.pdf"));
+ EXPECT_NE(nullptr, LoadPage(0));
+}