m_pColorSpace can not be NULL for image object with DCTDecode filter
authorBo Xu <bo_xu@foxitsoftware.com>
Thu, 11 Dec 2014 22:24:35 +0000 (14:24 -0800)
committerBo Xu <bo_xu@foxitsoftware.com>
Thu, 11 Dec 2014 22:24:35 +0000 (14:24 -0800)
BUG=411842
R=tsepez@chromium.org

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

core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp

index f053e55..1637655 100644 (file)
@@ -504,6 +504,9 @@ FX_BOOL CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dict
 }
 DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, FX_BOOL& bColorKey)
 {
+    if (m_pColorSpace == NULL) {
+        return NULL;
+    }
     DIB_COMP_DATA* pCompData = FX_Alloc(DIB_COMP_DATA, m_nComponents);
     if (pCompData == NULL) {
         return NULL;