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

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

Issue 341333004: Fix crash in _CMapLookupCallback (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: generation number checking 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 | « core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp ('k') | 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 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 CPDF_Object* pObj = m_Syntax.GetObject(pObjList, objnum, gennum, 0, pContext ); 1377 CPDF_Object* pObj = m_Syntax.GetObject(pObjList, objnum, gennum, 0, pContext );
1378 FX_FILESIZE endOffset = m_Syntax.SavePos(); 1378 FX_FILESIZE endOffset = m_Syntax.SavePos();
1379 CFX_ByteString bsWord = m_Syntax.GetKeyword(); 1379 CFX_ByteString bsWord = m_Syntax.GetKeyword();
1380 if (bsWord == FX_BSTRC("endobj")) { 1380 if (bsWord == FX_BSTRC("endobj")) {
1381 endOffset = m_Syntax.SavePos(); 1381 endOffset = m_Syntax.SavePos();
1382 } 1382 }
1383 FX_DWORD objSize = endOffset - objOffset; 1383 FX_DWORD objSize = endOffset - objOffset;
1384 m_Syntax.RestorePos(SavedPos); 1384 m_Syntax.RestorePos(SavedPos);
1385 if (pObj && !objnum) { 1385 if (pObj && !objnum) {
1386 pObj->m_ObjNum = real_objnum; 1386 pObj->m_ObjNum = real_objnum;
1387 pObj->m_GenNum = gennum;
1387 } 1388 }
1388 return pObj; 1389 return pObj;
1389 } 1390 }
1390 CPDF_Object* CPDF_Parser::ParseIndirectObjectAtByStrict(CPDF_IndirectObjects* pO bjList, FX_FILESIZE pos, FX_DWORD objnum, 1391 CPDF_Object* CPDF_Parser::ParseIndirectObjectAtByStrict(CPDF_IndirectObjects* pO bjList, FX_FILESIZE pos, FX_DWORD objnum,
1391 struct PARSE_CONTEXT* pContext, FX_FILESIZE *pResultPos) 1392 struct PARSE_CONTEXT* pContext, FX_FILESIZE *pResultPos)
1392 { 1393 {
1393 FX_FILESIZE SavedPos = m_Syntax.SavePos(); 1394 FX_FILESIZE SavedPos = m_Syntax.SavePos();
1394 m_Syntax.RestorePos(pos); 1395 m_Syntax.RestorePos(pos);
1395 FX_BOOL bIsNumber; 1396 FX_BOOL bIsNumber;
1396 CFX_ByteString word = m_Syntax.GetNextWord(bIsNumber); 1397 CFX_ByteString word = m_Syntax.GetNextWord(bIsNumber);
(...skipping 2983 matching lines...) Expand 10 before | Expand all | Expand 10 after
4380 { 4381 {
4381 FX_INT32 iSize = m_childNode.GetSize(); 4382 FX_INT32 iSize = m_childNode.GetSize();
4382 for (FX_INT32 i = 0; i < iSize; ++i) { 4383 for (FX_INT32 i = 0; i < iSize; ++i) {
4383 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i]; 4384 CPDF_PageNode *pNode = (CPDF_PageNode*)m_childNode[i];
4384 if (pNode) { 4385 if (pNode) {
4385 delete pNode; 4386 delete pNode;
4386 } 4387 }
4387 } 4388 }
4388 m_childNode.RemoveAll(); 4389 m_childNode.RemoveAll();
4389 } 4390 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698