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

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

Issue 341333004: Fix crash in _CMapLookupCallback (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 6 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 void CPDF_Object::Release() 8 void CPDF_Object::Release()
9 { 9 {
10 if (this == NULL) { 10 if (this == NULL) {
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 ((CPDF_Object*)value)->Destroy(); 1323 ((CPDF_Object*)value)->Destroy();
1324 m_IndirectObjs.RemoveKey((FX_LPVOID)(FX_UINTPTR)objnum); 1324 m_IndirectObjs.RemoveKey((FX_LPVOID)(FX_UINTPTR)objnum);
1325 } 1325 }
1326 void CPDF_IndirectObjects::InsertIndirectObject(FX_DWORD objnum, CPDF_Object* pO bj) 1326 void CPDF_IndirectObjects::InsertIndirectObject(FX_DWORD objnum, CPDF_Object* pO bj)
1327 { 1327 {
1328 if (objnum == 0 || pObj == NULL) { 1328 if (objnum == 0 || pObj == NULL) {
1329 return; 1329 return;
1330 } 1330 }
1331 FX_LPVOID value; 1331 FX_LPVOID value;
1332 if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) { 1332 if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) {
1333 ((CPDF_Object*)value)->Destroy(); 1333 return;
palmer 2014/06/25 23:21:44 But the caller is going to expect that this functi
1334 } 1334 }
1335 pObj->m_ObjNum = objnum; 1335 pObj->m_ObjNum = objnum;
1336 m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pObj); 1336 m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pObj);
1337 if (m_LastObjNum < objnum) { 1337 if (m_LastObjNum < objnum) {
1338 m_LastObjNum = objnum; 1338 m_LastObjNum = objnum;
1339 } 1339 }
1340 } 1340 }
1341 FX_DWORD CPDF_IndirectObjects::GetLastObjNum() const 1341 FX_DWORD CPDF_IndirectObjects::GetLastObjNum() const
1342 { 1342 {
1343 return m_LastObjNum; 1343 return m_LastObjNum;
1344 } 1344 }
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