| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h" | 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 return pObjStream->GetDict()->GetIntegerBy("N"); | 44 return pObjStream->GetDict()->GetIntegerBy("N"); |
| 45 } | 45 } |
| 46 | 46 |
| 47 int32_t GetStreamFirst(CPDF_StreamAcc* pObjStream) { | 47 int32_t GetStreamFirst(CPDF_StreamAcc* pObjStream) { |
| 48 return pObjStream->GetDict()->GetIntegerBy("First"); | 48 return pObjStream->GetDict()->GetIntegerBy("First"); |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| 52 | 52 |
| 53 CPDF_Parser::CPDF_Parser() | 53 CPDF_Parser::CPDF_Parser() |
| 54 : m_bHasParsed(false), | 54 : m_pDocument(nullptr), |
| 55 m_bHasParsed(false), |
| 55 m_bOwnFileRead(true), | 56 m_bOwnFileRead(true), |
| 56 m_FileVersion(0), | 57 m_FileVersion(0), |
| 57 m_pTrailer(nullptr), | 58 m_pTrailer(nullptr), |
| 58 m_pEncryptDict(nullptr), | 59 m_pEncryptDict(nullptr), |
| 59 m_bVersionUpdated(false), | 60 m_bVersionUpdated(false), |
| 60 m_pLinearized(nullptr), | 61 m_pLinearized(nullptr), |
| 61 m_dwFirstPageNo(0), | 62 m_dwFirstPageNo(0), |
| 62 m_dwXrefStartObjNum(0) { | 63 m_dwXrefStartObjNum(0) { |
| 63 m_pSyntax.reset(new CPDF_SyntaxParser); | 64 m_pSyntax.reset(new CPDF_SyntaxParser); |
| 64 } | 65 } |
| (...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1661 if (!LoadLinearizedAllCrossRefV4(m_LastXRefOffset, m_dwXrefStartObjNum) && | 1662 if (!LoadLinearizedAllCrossRefV4(m_LastXRefOffset, m_dwXrefStartObjNum) && |
| 1662 !LoadLinearizedAllCrossRefV5(m_LastXRefOffset)) { | 1663 !LoadLinearizedAllCrossRefV5(m_LastXRefOffset)) { |
| 1663 m_LastXRefOffset = 0; | 1664 m_LastXRefOffset = 0; |
| 1664 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; | 1665 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; |
| 1665 return FORMAT_ERROR; | 1666 return FORMAT_ERROR; |
| 1666 } | 1667 } |
| 1667 | 1668 |
| 1668 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; | 1669 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; |
| 1669 return SUCCESS; | 1670 return SUCCESS; |
| 1670 } | 1671 } |
| OLD | NEW |