Add a null pointer check to CPDF_CalRGB::v_Load().
authorLei Zhang <thestig@chromium.org>
Wed, 15 Jul 2015 23:11:10 +0000 (16:11 -0700)
committerLei Zhang <thestig@chromium.org>
Wed, 15 Jul 2015 23:11:10 +0000 (16:11 -0700)
BUG=492055
R=tsepez@chromium.org

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

core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp

index 9e6ca67..101a197 100644 (file)
@@ -348,6 +348,9 @@ public:
 FX_BOOL CPDF_CalRGB::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 ++) {