summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-08-28 11:31:56 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-08-28 19:21:26 +0000
commit827f6ff220edea40252e52d128662d37a591fdb9 (patch)
tree64677506bd3197dff14fcfd618c5486f37c473e5 /core/fpdfapi
parent9084a1286c8cd9ead4d6d7bd177a22a3c67d3afb (diff)
downloadpdfium-827f6ff220edea40252e52d128662d37a591fdb9.tar.xz
Add a nullptr check in ReplaceIndirectObjectIfHigherGeneration().
Avoid pushing nullptrs into the orphans list. Change-Id: I2d52c83e6f20e89be101365d3cca0960b4941a4f Reviewed-on: https://pdfium-review.googlesource.com/12190 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/parser/cpdf_indirect_object_holder.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/fpdfapi/parser/cpdf_indirect_object_holder.cpp b/core/fpdfapi/parser/cpdf_indirect_object_holder.cpp
index 93795b62be..aee527618f 100644
--- a/core/fpdfapi/parser/cpdf_indirect_object_holder.cpp
+++ b/core/fpdfapi/parser/cpdf_indirect_object_holder.cpp
@@ -75,7 +75,8 @@ bool CPDF_IndirectObjectHolder::ReplaceIndirectObjectIfHigherGeneration(
return false;
pObj->m_ObjNum = objnum;
- m_OrphanObjs.push_back(std::move(m_IndirectObjs[objnum]));
+ if (m_IndirectObjs[objnum])
+ m_OrphanObjs.push_back(std::move(m_IndirectObjs[objnum]));
m_IndirectObjs[objnum] = std::move(pObj);
m_LastObjNum = std::max(m_LastObjNum, objnum);
return true;