Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Side by Side Diff: core/fpdfapi/fpdf_parser/cpdf_parser.cpp

Issue 2291743002: Initialize the CPDF_Document pointer (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698