Add a NULL check in pdf_page_colors.cpp
authorOliver Chang <ochang@chromium.org>
Wed, 28 Oct 2015 18:49:02 +0000 (11:49 -0700)
committerOliver Chang <ochang@chromium.org>
Wed, 28 Oct 2015 18:49:02 +0000 (11:49 -0700)
R=thestig@chromium.org
BUG=548714

Review URL: https://codereview.chromium.org/1430653002 .

core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp

index bed3cfb..e4bb1a3 100644 (file)
@@ -327,6 +327,9 @@ class CPDF_CalGray : public CPDF_ColorSpace {
 
 FX_BOOL CPDF_CalGray::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++) {