From 827f6ff220edea40252e52d128662d37a591fdb9 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 28 Aug 2017 11:31:56 -0700 Subject: 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 Commit-Queue: Lei Zhang --- core/fpdfapi/parser/cpdf_indirect_object_holder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3