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

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

Issue 368783004: Fix uninitialized offset (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 5 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 "../fpdf_page/pageint.h" 10 #include "../fpdf_page/pageint.h"
(...skipping 3060 matching lines...) Expand 10 before | Expand all | Expand 10 after
3071 if (!m_pFileAvail->IsDataAvail(offset, size)) { 3071 if (!m_pFileAvail->IsDataAvail(offset, size)) {
3072 pHints->AddSegment(offset, size); 3072 pHints->AddSegment(offset, size);
3073 return NULL; 3073 return NULL;
3074 } 3074 }
3075 pRet = m_parser.ParseIndirectObject(NULL, objnum); 3075 pRet = m_parser.ParseIndirectObject(NULL, objnum);
3076 if (!pRet && pExistInFile) { 3076 if (!pRet && pExistInFile) {
3077 *pExistInFile = FALSE; 3077 *pExistInFile = FALSE;
3078 } 3078 }
3079 return pRet; 3079 return pRet;
3080 } 3080 }
3081 FX_FILESIZE offset; 3081 FX_FILESIZE offset = 0;
3082 FX_DWORD size = GetObjectSize(objnum, offset); 3082 FX_DWORD size = GetObjectSize(objnum, offset);
3083 size = (FX_DWORD)((FX_FILESIZE)(offset + size + 512) > m_dwFileLen ? m_dwFil eLen - offset : size + 512); 3083 size = (FX_DWORD)((FX_FILESIZE)(offset + size + 512) > m_dwFileLen ? m_dwFil eLen - offset : size + 512);
3084 if (!m_pFileAvail->IsDataAvail(offset, size)) { 3084 if (!m_pFileAvail->IsDataAvail(offset, size)) {
3085 pHints->AddSegment(offset, size); 3085 pHints->AddSegment(offset, size);
3086 return NULL; 3086 return NULL;
3087 } 3087 }
3088 CPDF_Parser *pParser = (CPDF_Parser *)(m_pDocument->GetParser()); 3088 CPDF_Parser *pParser = (CPDF_Parser *)(m_pDocument->GetParser());
3089 pRet = pParser->ParseIndirectObject(NULL, objnum, NULL); 3089 pRet = pParser->ParseIndirectObject(NULL, objnum, NULL);
3090 if (!pRet && pExistInFile) { 3090 if (!pRet && pExistInFile) {
3091 *pExistInFile = FALSE; 3091 *pExistInFile = FALSE;
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
4380 { 4380 {
4381 FX_INT32 iSize = m_childNode.GetSize(); 4381 FX_INT32 iSize = m_childNode.GetSize();
4382 for (FX_INT32 i = 0; i < iSize; ++i) { 4382 for (FX_INT32 i = 0; i < iSize; ++i) {
4383 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; 4383 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i];
4384 if (pNode) { 4384 if (pNode) {
4385 delete pNode; 4385 delete pNode;
4386 } 4386 }
4387 } 4387 }
4388 m_childNode.RemoveAll(); 4388 m_childNode.RemoveAll();
4389 } 4389 }
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