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

Side by Side Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp

Issue 504993002: Set m_pLinearized to NULL after release (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 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 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 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 "../../../include/fpdfapi/fpdf_parser.h" 7 #include "../../../include/fpdfapi/fpdf_parser.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "../../../include/fpdfapi/fpdf_page.h" 9 #include "../../../include/fpdfapi/fpdf_page.h"
10 #include "../../../../third_party/numerics/safe_math.h" 10 #include "../../../../third_party/numerics/safe_math.h"
(...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1490 } 1490 }
1491 m_pLinearized = m_Syntax.GetObject(NULL, objnum, gennum, 0); 1491 m_pLinearized = m_Syntax.GetObject(NULL, objnum, gennum, 0);
1492 if (!m_pLinearized) { 1492 if (!m_pLinearized) {
1493 return FALSE; 1493 return FALSE;
1494 } 1494 }
1495 if (m_pLinearized->GetDict() && m_pLinearized->GetDict()->GetElement(FX_BSTR C("Linearized"))) { 1495 if (m_pLinearized->GetDict() && m_pLinearized->GetDict()->GetElement(FX_BSTR C("Linearized"))) {
1496 m_Syntax.GetNextWord(bIsNumber); 1496 m_Syntax.GetNextWord(bIsNumber);
1497 CPDF_Object *pLen = m_pLinearized->GetDict()->GetElement(FX_BSTRC("L")); 1497 CPDF_Object *pLen = m_pLinearized->GetDict()->GetElement(FX_BSTRC("L"));
1498 if (!pLen) { 1498 if (!pLen) {
1499 m_pLinearized->Release(); 1499 m_pLinearized->Release();
1500 m_pLinearized = NULL;
1500 return FALSE; 1501 return FALSE;
1501 } 1502 }
1502 if (pLen->GetInteger() != (int)pFileAccess->GetSize()) { 1503 if (pLen->GetInteger() != (int)pFileAccess->GetSize()) {
1503 return FALSE; 1504 return FALSE;
1504 } 1505 }
1505 CPDF_Object *pNo = m_pLinearized->GetDict()->GetElement(FX_BSTRC("P")); 1506 CPDF_Object *pNo = m_pLinearized->GetDict()->GetElement(FX_BSTRC("P"));
1506 if (pNo && pNo->GetType() == PDFOBJ_NUMBER) { 1507 if (pNo && pNo->GetType() == PDFOBJ_NUMBER) {
1507 m_dwFirstPageNo = pNo->GetInteger(); 1508 m_dwFirstPageNo = pNo->GetInteger();
1508 } 1509 }
1509 CPDF_Object *pTable = m_pLinearized->GetDict()->GetElement(FX_BSTRC("T") ); 1510 CPDF_Object *pTable = m_pLinearized->GetDict()->GetElement(FX_BSTRC("T") );
(...skipping 2902 matching lines...) Expand 10 before | Expand all | Expand 10 after
4412 { 4413 {
4413 FX_INT32 iSize = m_childNode.GetSize(); 4414 FX_INT32 iSize = m_childNode.GetSize();
4414 for (FX_INT32 i = 0; i < iSize; ++i) { 4415 for (FX_INT32 i = 0; i < iSize; ++i) {
4415 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; 4416 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i];
4416 if (pNode) { 4417 if (pNode) {
4417 delete pNode; 4418 delete pNode;
4418 } 4419 }
4419 } 4420 }
4420 m_childNode.RemoveAll(); 4421 m_childNode.RemoveAll();
4421 } 4422 }
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