summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfppo.cpp
diff options
context:
space:
mode:
authorJun Fang <jun_fang@foxitsoftware.com>2014-09-08 11:27:02 -0700
committerJun Fang <jun_fang@foxitsoftware.com>2014-09-08 11:27:02 -0700
commit4cf36954a1676e103f899bee0138610c76500b42 (patch)
tree2544f42020b2236d6acbddc2258dfa444e5e9560 /fpdfsdk/src/fpdfppo.cpp
parente6e40abd9753c50917c1fc47f10c105ebe489e58 (diff)
downloadpdfium-4cf36954a1676e103f899bee0138610c76500b42.tar.xz
The cause of this issue is that there is an indirect object like '112 0 R' but no its direct object '112 0 object' in the test pdf file. Without checking the validity, it causes a null pointer when trying to get the direct object by an indirect object.
BUG=390781 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/553613003
Diffstat (limited to 'fpdfsdk/src/fpdfppo.cpp')
-rw-r--r--fpdfsdk/src/fpdfppo.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp
index b8d2125b7d..a5c4275648 100644
--- a/fpdfsdk/src/fpdfppo.cpp
+++ b/fpdfsdk/src/fpdfppo.cpp
@@ -313,9 +313,17 @@ int CPDF_PageOrganizer::GetNewObjId(CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPt
}
else
{
- CPDF_Object* pClone = pRef->GetDirect()->Clone();
- if(!pClone)
+ CPDF_Object* pDirect = pRef->GetDirect();
+ if(!pDirect)
+ {
+ return 0;
+ }
+
+ CPDF_Object* pClone = pDirect->Clone();
+ if(!pClone)
+ {
return 0;
+ }
if(pClone->GetType() == PDFOBJ_DICTIONARY)
{