Chromium Code Reviews| Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp |
| diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp |
| index e098112ba1bb9aefa832dc95d40a08b0594a3703..8a6e780e3963d9be3a1d64f147d048a7d2227a93 100644 |
| --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp |
| +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp |
| @@ -3600,9 +3600,11 @@ FX_BOOL CPDF_DataAvail::CheckHintTables(IFX_DownloadHints* pHints) { |
| m_syntaxParser.InitParser(m_pFileRead, m_dwHeaderOffset); |
| nonstd::unique_ptr<CPDF_HintTables> pHintTables( |
| new CPDF_HintTables(this, pDict)); |
| - CPDF_Stream* pHintStream = (CPDF_Stream*)ParseIndirectObjectAt(szHSStart, 0); |
| + nonstd::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> pHintStream( |
| + ParseIndirectObjectAt(szHSStart, 0)); |
| + |
|
Lei Zhang
2015/12/18 22:09:12
What do you think of this?
nonstd::unique_ptr<CPD
Oliver Chang
2015/12/18 22:18:30
Thanks for the suggestion. I've simplified this a
|
| if (pHintStream && pHintStream->GetType() == PDFOBJ_STREAM && |
| - pHintTables->LoadHintStream(pHintStream)) |
| + pHintTables->LoadHintStream(pHintStream->AsStream())) |
| m_pHintTables.reset(pHintTables.release()); |
| m_docStatus = PDF_DATAAVAIL_DONE; |