diff options
author | Lei Zhang <thestig@chromium.org> | 2017-08-28 11:31:56 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-28 19:21:26 +0000 |
commit | 827f6ff220edea40252e52d128662d37a591fdb9 (patch) | |
tree | 64677506bd3197dff14fcfd618c5486f37c473e5 /core/fpdfapi | |
parent | 9084a1286c8cd9ead4d6d7bd177a22a3c67d3afb (diff) | |
download | pdfium-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.cpp | 3 |
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; |