From 0c32f02cf5dabd80c03f3af34874b5f84535b1ef Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Fri, 14 Nov 2014 17:22:13 -0800 Subject: Check NULL pointer dereferencing from GetDirect BUG=431770 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/728993002 --- xfa/src/fxfa/src/app/xfa_ffdoc.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'xfa/src/fxfa') diff --git a/xfa/src/fxfa/src/app/xfa_ffdoc.cpp b/xfa/src/fxfa/src/app/xfa_ffdoc.cpp index 9c686036c0..625a34db4b 100644 --- a/xfa/src/fxfa/src/app/xfa_ffdoc.cpp +++ b/xfa/src/fxfa/src/app/xfa_ffdoc.cpp @@ -233,15 +233,11 @@ FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) if (pAcroForm == NULL) { return FALSE; } - CPDF_Object* pElementXFA = pAcroForm->GetElement(FX_BSTRC("XFA")); + CPDF_Object* pElementXFA = pAcroForm->GetElementValue(FX_BSTRC("XFA")); if (pElementXFA == NULL) { return FALSE; } FX_INT32 iObjType = pElementXFA->GetType(); - if (iObjType == PDFOBJ_REFERENCE) { - pElementXFA = pElementXFA->GetDirect(); - iObjType = pElementXFA->GetType(); - } CFX_ArrayTemplate xfaStreams; if (iObjType == PDFOBJ_ARRAY) { CPDF_Array* pXFAArray = (CPDF_Array*)pElementXFA; -- cgit v1.2.3