Check NULL pointer dereferencing from GetDirect
authorBo Xu <bo_xu@foxitsoftware.com>
Sat, 15 Nov 2014 01:22:13 +0000 (17:22 -0800)
committerBo Xu <bo_xu@foxitsoftware.com>
Sat, 15 Nov 2014 01:22:13 +0000 (17:22 -0800)
BUG=431770
R=tsepez@chromium.org

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

xfa/src/fxfa/src/app/xfa_ffdoc.cpp

index 9c68603..625a34d 100644 (file)
@@ -233,15 +233,11 @@ FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc)
     if (pAcroForm == NULL) {\r
         return FALSE;\r
     }\r
-    CPDF_Object* pElementXFA = pAcroForm->GetElement(FX_BSTRC("XFA"));\r
+    CPDF_Object* pElementXFA = pAcroForm->GetElementValue(FX_BSTRC("XFA"));\r
     if (pElementXFA == NULL) {\r
         return FALSE;\r
     }\r
     FX_INT32 iObjType = pElementXFA->GetType();\r
-    if (iObjType == PDFOBJ_REFERENCE) {\r
-        pElementXFA = pElementXFA->GetDirect();\r
-        iObjType = pElementXFA->GetType();\r
-    }\r
     CFX_ArrayTemplate<CPDF_Stream*> xfaStreams;\r
     if (iObjType == PDFOBJ_ARRAY) {\r
         CPDF_Array* pXFAArray = (CPDF_Array*)pElementXFA;\r