Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1668)

Unified Diff: xfa/src/fxfa/src/app/xfa_ffdoc.cpp

Issue 728993002: Check NULL pointer dereferencing from GetDirect (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Use GetElementValue() Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fxfa/src/app/xfa_ffdoc.cpp
diff --git a/xfa/src/fxfa/src/app/xfa_ffdoc.cpp b/xfa/src/fxfa/src/app/xfa_ffdoc.cpp
index 9c686036c0f98561f2a189622fbf71a52144839f..625a34db4bca9aed75391668d29c2aa88ed5a13d 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<CPDF_Stream*> xfaStreams;
if (iObjType == PDFOBJ_ARRAY) {
CPDF_Array* pXFAArray = (CPDF_Array*)pElementXFA;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698