From a9f327580558a96f659e96157731f21c6abbb951 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 5 Jun 2018 18:40:02 +0000 Subject: Assert CPDF_ContentParser always has a valid page holder. Change-Id: Ia9b3066c8076ed296125bf514c07f7118c52dd05 Reviewed-on: https://pdfium-review.googlesource.com/33850 Reviewed-by: dsinclair Commit-Queue: Lei Zhang --- core/fpdfapi/page/cpdf_contentparser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/fpdfapi/page/cpdf_contentparser.cpp b/core/fpdfapi/page/cpdf_contentparser.cpp index 82f288f22b..c079f99cbf 100644 --- a/core/fpdfapi/page/cpdf_contentparser.cpp +++ b/core/fpdfapi/page/cpdf_contentparser.cpp @@ -23,7 +23,8 @@ CPDF_ContentParser::CPDF_ContentParser(CPDF_Page* pPage) : m_CurrentStage(Stage::kGetContent), m_pObjectHolder(pPage) { - if (!pPage || !pPage->GetDocument() || !pPage->GetFormDict()) { + ASSERT(pPage); + if (!pPage->GetDocument() || !pPage->GetFormDict()) { m_CurrentStage = Stage::kComplete; return; } @@ -66,6 +67,7 @@ CPDF_ContentParser::CPDF_ContentParser(CPDF_Form* pForm, : m_CurrentStage(Stage::kParse), m_pObjectHolder(pForm), m_pType3Char(pType3Char) { + ASSERT(pForm); CFX_Matrix form_matrix = pForm->GetFormDict()->GetMatrixFor("Matrix"); if (pGraphicStates) form_matrix.Concat(pGraphicStates->m_CTM); -- cgit v1.2.3