summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
index 187d6152e9..9adfdb21a4 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
@@ -92,7 +92,7 @@ void CPDF_StreamContentParser::Handle_BeginImage() {
nonstd::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> pObj(
m_pSyntax->ReadNextObject());
if (!key.IsEmpty()) {
- FX_DWORD dwObjNum = pObj->GetObjNum();
+ FX_DWORD dwObjNum = pObj ? pObj->GetObjNum() : 0;
if (dwObjNum)
pDict->SetAtReference(key, m_pDocument, dwObjNum);
else
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
index 26f5595eaf..96f15ecb9d 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -852,7 +852,8 @@ FX_BOOL CPDF_Parser::RebuildCrossRef() {
CFX_ByteString key;
CPDF_Object* pElement =
pTrailer->GetNextElement(pos, key);
- FX_DWORD dwObjNum = pElement->GetObjNum();
+ FX_DWORD dwObjNum =
+ pElement ? pElement->GetObjNum() : 0;
if (dwObjNum) {
m_pTrailer->SetAtReference(key, m_pDocument,
dwObjNum);